Adding check to no overwrite cache if it has not been modified

This commit is contained in:
José Lorenzo Rodríguez 2010-12-07 00:00:20 -04:30
parent 6de52f795f
commit 9e64754005
5 changed files with 8 additions and 1 deletions

View file

@ -213,6 +213,12 @@ class App {
*/
private static $__packages = array();
/**
* Inicates whether the cache should be stored again because of an addition to it
*
*/
private static $_cacheChange = false;
/**
* Used to read information stored path
*
@ -691,6 +697,7 @@ class App {
} else {
self::$__map[$name] = $file;
}
self::$_cacheChange = true;
}
/**
@ -897,7 +904,7 @@ class App {
* @return void
*/
public static function shutdown() {
if (self::$__cache) {
if (self::$__cache && self::$_cacheChange) {
Cache::write('file_map', array_filter(self::$__map), '_cake_core_');
Cache::write('object_map', self::$__objects, '_cake_core_');
}