Changeset 2718
- Timestamp:
- 05/29/2008 04:18:31 PM (6 months ago)
- Location:
- trunk/system/core
- Files:
-
- 2 modified
-
Config.php (modified) (4 diffs)
-
Kohana.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/system/core/Config.php
r2716 r2718 17 17 // Cached configuration 18 18 private static $cache; 19 private static $cache_changed = FALSE;20 19 21 20 // Include paths … … 134 133 public static function clear($key) 135 134 { 136 if (isset($cache[$key]))137 {138 // Cache has been changed139 self::$cache_changed = TRUE;140 }141 142 135 unset(self::$conf[$key], self::$cache[$key]); 136 137 // Save updated cache 138 Kohana::save_cache('configuration', self::$cache); 143 139 144 140 return TRUE; … … 220 216 } 221 217 222 if (self::$cache_changed === FALSE AND (bool) Config::item('core.internal_cache')) 223 { 224 // Write the caches on shutdown 225 Event::add('system.shutdown', array('Config', 'save_cache')); 226 } 227 228 // Cache has been changed 229 self::$cache_changed = TRUE; 218 // Save updated cache 219 Kohana::save_cache('configuration', self::$cache); 230 220 231 221 // Cache the configuration … … 233 223 } 234 224 235 /**236 * Writes configuration caches, typically called during shutdown.237 *238 * @return bool239 */240 public static function save_cache()241 {242 if (self::$cache_changed === TRUE)243 {244 // Write caches245 return Kohana::save_cache('configuration', self::$cache);246 }247 }248 249 225 } // End Config -
trunk/system/core/Kohana.php
r2716 r2718 29 29 // File path cache 30 30 private static $paths; 31 private static $paths_changed = FALSE;32 31 33 32 /** … … 811 810 } 812 811 813 if (self::$paths_changed === FALSE AND (bool) Config::item('core.internal_cache')) 814 { 815 // Write the caches on shutdown 816 Event::add('system.shutdown', array('Kohana', 'save_paths')); 817 } 818 819 // Paths have been changed 820 self::$paths_changed = TRUE; 812 // Save updated cache 813 Kohana::save_cache('file_paths', self::$paths); 821 814 822 815 return self::$paths[$search] = $found; 823 }824 825 /**826 * Writes file path caches, typically called during shutdown.827 *828 * @return bool829 */830 public static function save_paths()831 {832 if (self::$paths_changed === TRUE)833 {834 // Write caches835 return Kohana::save_cache('file_paths', self::$paths);836 }837 816 } 838 817
