mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
updating AclComponent to load custom component which should extend AclBase
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@5424 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
a6782f0b72
commit
dcbab2da0f
1 changed files with 12 additions and 1 deletions
|
@ -53,7 +53,18 @@ class AclComponent extends Object {
|
|||
*/
|
||||
function &getACL() {
|
||||
if ($this->_instance == null) {
|
||||
$this->_instance =& new $this->name();
|
||||
$name = $this->name;
|
||||
if(!class_exists($name)) {
|
||||
if(loadComponent($name)) {
|
||||
if (strpos($name, '.') !== false) {
|
||||
list($plugin, $name) = explode('.', $name);
|
||||
}
|
||||
$name .= 'Component';
|
||||
} else {
|
||||
trigger_error(__(sprintf('Could not find %s.', $name), true), E_USER_WARNING);
|
||||
}
|
||||
}
|
||||
$this->_instance =& new $name();
|
||||
$this->_instance->initialize($this);
|
||||
}
|
||||
return $this->_instance;
|
||||
|
|
Loading…
Reference in a new issue