updating cache with new component callback handling

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@7101 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2008-06-03 05:12:12 +00:00
parent 394fe24e90
commit a13232659f

View file

@ -240,7 +240,7 @@ class CacheHelper extends AppHelper {
';
}
$file .= '$controller = new ' . $this->controllerName . 'Controller();
$file .= '$controller =& new ' . $this->controllerName . 'Controller();
$controller->plugin = $this->plugin = \''.$this->plugin.'\';
$controller->helpers = $this->helpers = unserialize(\'' . serialize($this->helpers) . '\');
$controller->base = $this->base = \'' . $this->base . '\';
@ -257,16 +257,7 @@ class CacheHelper extends AppHelper {
if ($useCallbacks == true) {
$file .= '$controller->constructClasses();
$controller->beforeFilter();
foreach ($controller->components as $c) {
$path = preg_split(\'/\/|\./\', $c);
$c = $path[count($path) - 1];
if (isset($controller->{$c}) && is_object($controller->{$c}) && is_callable(array($controller->{$c}, \'startup\'))) {
if (!array_key_exists(\'enabled\', get_object_vars($controller->{$c})) || $controller->{$c}->enabled == true) {
$controller->{$c}->startup($controller);
}
}
}';
$controller->Component->startup($controller);';
}
$file .= '