diff --git a/lib/Cake/Core/App.php b/lib/Cake/Core/App.php index ae9942553..e36b10a24 100644 --- a/lib/Cake/Core/App.php +++ b/lib/Cake/Core/App.php @@ -425,6 +425,10 @@ class App { * @link http://book.cakephp.org/2.0/en/core-utility-libraries/app.html#App::objects */ public static function objects($type, $path = null, $cache = true) { + if (empty(self::$_objects) && $cache === true) { + self::$_objects = (array)Cache::read('object_map', '_cake_core_'); + } + $extension = '/\.php$/'; $includeDirectories = false; $name = $type; @@ -451,10 +455,6 @@ class App { $name = $type . str_replace(DS, '', $path); } - if (empty(self::$_objects) && $cache === true) { - self::$_objects = Cache::read('object_map', '_cake_core_'); - } - $cacheLocation = empty($plugin) ? 'app' : $plugin; if ($cache !== true || !isset(self::$_objects[$cacheLocation][$name])) { @@ -768,7 +768,6 @@ class App { */ public static function init() { self::$_map += (array)Cache::read('file_map', '_cake_core_'); - self::$_objects += (array)Cache::read('object_map', '_cake_core_'); register_shutdown_function(array('App', 'shutdown')); } @@ -896,7 +895,6 @@ class App { if (self::$_objectCacheChange) { Cache::write('object_map', self::$_objects, '_cake_core_'); } - self::_checkFatalError(); }