mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-09-03 01:52:40 +00:00
Implementing shutdown() callback for components
git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4320 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
parent
51cf77d4cc
commit
dcca6e711c
1 changed files with 8 additions and 0 deletions
|
@ -348,6 +348,14 @@ class Dispatcher extends Object {
|
|||
$output = $controller->render();
|
||||
}
|
||||
$controller->output =& $output;
|
||||
|
||||
foreach($controller->components as $c) {
|
||||
if (isset($controller->{$c}) && is_object($controller->{$c}) && is_callable(array($controller->{$c}, 'shutdown'))) {
|
||||
if (!array_key_exists('enabled', get_object_vars($controller->{$c})) || $controller->{$c}->enabled == true) {
|
||||
$controller->{$c}->shutdown($controller);
|
||||
}
|
||||
}
|
||||
}
|
||||
$controller->afterFilter();
|
||||
return $controller->output;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue