diff options
| author | Tim Almdal <tnalmdal@shaw.ca> | 2010-02-28 15:39:39 -0800 | 
|---|---|---|
| committer | Tim Almdal <tnalmdal@shaw.ca> | 2010-02-28 15:39:39 -0800 | 
| commit | c91408d4a8b56730fde39df5e12d32111ace28b4 (patch) | |
| tree | 0316bd3dc835f36c200438769f0ae468833ac1c5 /system/core/Kohana.php | |
| parent | fd94f4bec21a7deaa86d468da704a048d2be751e (diff) | |
Its not apppropriate to make changes to the Kohana system files. Please find another way.
Revert "Fix Kohana's internal cache for Gallery's usage pattern. Instead of deleting the whole find_files cache when ever include_paths (=core.modules) change, keep a separate find_files cache for each set of include_paths."
This reverts commit fd94f4bec21a7deaa86d468da704a048d2be751e.
Diffstat (limited to 'system/core/Kohana.php')
| -rw-r--r-- | system/core/Kohana.php | 16 | 
1 files changed, 11 insertions, 5 deletions
| diff --git a/system/core/Kohana.php b/system/core/Kohana.php index f7f6b326..ae056d0e 100644 --- a/system/core/Kohana.php +++ b/system/core/Kohana.php @@ -32,7 +32,6 @@ abstract class Kohana_Core {  	// Include paths  	protected static $include_paths; -	protected static $include_paths_hash = '';  	// Cache lifetime  	protected static $cache_lifetime; @@ -366,7 +365,14 @@ abstract class Kohana_Core {  			// Add SYSPATH as the last path  			Kohana::$include_paths[] = SYSPATH; -			Kohana::$include_paths_hash = md5(serialize(Kohana::$include_paths)); +			// Clear cached include paths +			self::$internal_cache['find_file_paths'] = array(); +			if ( ! isset(self::$write_cache['find_file_paths'])) +			{ +				// Write cache at shutdown +				self::$write_cache['find_file_paths'] = TRUE; +			} +  		}  		return Kohana::$include_paths; @@ -760,8 +766,8 @@ abstract class Kohana_Core {  		// Search path  		$search = $directory.'/'.$filename.$ext; -		if (isset(Kohana::$internal_cache['find_file_paths'][Kohana::$include_paths_hash][$search])) -			return Kohana::$internal_cache['find_file_paths'][Kohana::$include_paths_hash][$search]; +		if (isset(Kohana::$internal_cache['find_file_paths'][$search])) +			return Kohana::$internal_cache['find_file_paths'][$search];  		// Load include paths  		$paths = Kohana::$include_paths; @@ -818,7 +824,7 @@ abstract class Kohana_Core {  			Kohana::$write_cache['find_file_paths'] = TRUE;  		} -		return Kohana::$internal_cache['find_file_paths'][Kohana::$include_paths_hash][$search] = $found; +		return Kohana::$internal_cache['find_file_paths'][$search] = $found;  	}  	/** | 
