Permalink
Browse files

Cherry-picking Kohana SVN revision r4827, which is the patch describe…

  • Loading branch information...
1 parent 723db68 commit 6ec9bcdb9eb094093043c9517c9a9ab3aff611eb @andyst andyst committed Mar 1, 2010
Showing with 12 additions and 23 deletions.
  1. +2 −1 kohana/README
  2. +5 −11 kohana/modified/system/core/Kohana.php
  3. +5 −11 kohana/upstream/system/core/Kohana.php
View
3 kohana/README
@@ -48,4 +48,5 @@ To see the differences you can run a diff command
$ diff -r modified/system ../../gallery3/system
Expected differences:
- http://dev.kohanaframework.org/issues/2477 Don't use Last_Modified header for expires handling
+ * http://dev.kohanaframework.org/issues/2477 Don't use Last_Modified header for expires handling
+ * http://dev.kohanaphp.com/issues/2640 This is fixed in Kohana SVN, we cherry-picked SVN changeset r4827. There should be no diff after the next full Kohana upstream update.
View
16 kohana/modified/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;
}
/**
View
16 kohana/upstream/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 6ec9bcd

Please sign in to comment.