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:
gwoo 2007-07-09 05:49:16 +00:00
parent a6782f0b72
commit dcbab2da0f

View file

@ -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;