Browse files

The vendor branch is being updated, so this reverts the revert of

commit c91408d.
  • Loading branch information...
1 parent c91408d commit 835027bdb6e5646250d29529168359ad40e9d5f1 @talmdal talmdal committed Mar 1, 2010
Showing with 5 additions and 11 deletions.
  1. +5 −11 system/core/Kohana.php
View
16 system/core/Kohana.php
@@ -32,6 +32,7 @@
// Include paths
protected static $include_paths;
+ protected static $include_paths_hash = '';
// Cache lifetime
protected static $cache_lifetime;
@@ -365,14 +366,7 @@ public static function include_paths($process = FALSE)
// Add SYSPATH as the last path
Kohana::$include_paths[] = SYSPATH;
- // 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;
- }
-
+ Kohana::$include_paths_hash = md5(serialize(Kohana::$include_paths));
}
return Kohana::$include_paths;
@@ -766,8 +760,8 @@ public static function find_file($directory, $filename, $required = FALSE, $ext
// Search path
$search = $directory.'/'.$filename.$ext;
- if (isset(Kohana::$internal_cache['find_file_paths'][$search]))
- return Kohana::$internal_cache['find_file_paths'][$search];
+ 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];
// Load include paths
$paths = Kohana::$include_paths;
@@ -824,7 +818,7 @@ public static function find_file($directory, $filename, $required = FALSE, $ext
Kohana::$write_cache['find_file_paths'] = TRUE;
}
- return Kohana::$internal_cache['find_file_paths'][$search] = $found;
+ return Kohana::$internal_cache['find_file_paths'][Kohana::$include_paths_hash][$search] = $found;
}
/**

0 comments on commit 835027b

Please sign in to comment.