mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Separating cache storing in App shutdown
This commit is contained in:
parent
0732552739
commit
322093a022
1 changed files with 10 additions and 1 deletions
|
@ -214,11 +214,17 @@ class App {
|
|||
private static $__packages = array();
|
||||
|
||||
/**
|
||||
* Inicates whether the cache should be stored again because of an addition to it
|
||||
* Inicates whether the class cache should be stored again because of an addition to it
|
||||
*
|
||||
*/
|
||||
private static $_cacheChange = false;
|
||||
|
||||
/**
|
||||
* Inicates whether the object cache should be stored again because of an addition to it
|
||||
*
|
||||
*/
|
||||
private static $_objectCacheChange = false;
|
||||
|
||||
/**
|
||||
* Used to read information stored path
|
||||
*
|
||||
|
@ -420,6 +426,7 @@ class App {
|
|||
self::$__cache = true;
|
||||
}
|
||||
self::$__objects[$name] = $objects;
|
||||
self::$_objectCacheChange = true;
|
||||
}
|
||||
|
||||
return self::$__objects[$name];
|
||||
|
@ -906,6 +913,8 @@ class App {
|
|||
public static function shutdown() {
|
||||
if (self::$__cache && self::$_cacheChange) {
|
||||
Cache::write('file_map', array_filter(self::$__map), '_cake_core_');
|
||||
}
|
||||
if (self::$__cache && self::$_objectCacheChange) {
|
||||
Cache::write('object_map', self::$__objects, '_cake_core_');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue