Browse Source

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

José Lorenzo Rodríguez 15 years ago
parent
commit
9e64754005

+ 8 - 1
lib/Cake/Core/App.php

@@ -214,6 +214,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
  *
  * Usage:
@@ -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_');
 		}

cake/libs/session/cache_session.php → lib/Cake/Model/Datasource/Session/CacheSession.php


cake/libs/session/database_session.php → lib/Cake/Model/Datasource/Session/DatabaseSession.php


cake/libs/route/plugin_short_route.php → lib/Cake/Routing/Route/PluginShortRoute.php


cake/libs/route/redirect_route.php → lib/Cake/Routing/Route/RedirectRoute.php