Commit ecad8099 by Seldaek

git-svn-id: svn://dwoo.org/dwoo/trunk@45 0598d79b-80c4-4d41-97ba-ac86fbbd088b

parent 860ce2d9
...@@ -1490,7 +1490,7 @@ class Dwoo_Loader ...@@ -1490,7 +1490,7 @@ class Dwoo_Loader
{ {
if(is_dir($f)) if(is_dir($f))
self::rebuildClassPathCache($f, false); self::rebuildClassPathCache($f, false);
elseif(basename($f) !== 'classpath.cache') else
self::$classpath[str_replace(array('function.','block.','modifier.','outputfilter.','filter.','prefilter.','postfilter.','pre.','post.','output.','shared.','helper.'), '', basename($f,'.php'))] = $f; self::$classpath[str_replace(array('function.','block.','modifier.','outputfilter.','filter.','prefilter.','postfilter.','pre.','post.','output.','shared.','helper.'), '', basename($f,'.php'))] = $f;
} }
...@@ -1514,8 +1514,8 @@ class Dwoo_Loader ...@@ -1514,8 +1514,8 @@ class Dwoo_Loader
if(!isset(self::$classpath[$class]) || !include self::$classpath[$class]) if(!isset(self::$classpath[$class]) || !include self::$classpath[$class])
{ {
self::rebuildClassPathCache(DWOO_DIRECTORY . 'plugins', DWOO_COMPILE_DIRECTORY . DIRECTORY_SEPARATOR . 'classpath.cache.php'); self::rebuildClassPathCache(DWOO_DIRECTORY . 'plugins', DWOO_COMPILE_DIRECTORY . DIRECTORY_SEPARATOR . 'classpath.cache.php');
foreach(self::$paths as $path) foreach(self::$paths as $path=>$file)
self::rebuildClassPathCache($path[0], $path[1]); self::rebuildClassPathCache($path, $file);
if(isset(self::$classpath[$class])) if(isset(self::$classpath[$class]))
include self::$classpath[$class]; include self::$classpath[$class];
else else
...@@ -1530,12 +1530,15 @@ class Dwoo_Loader ...@@ -1530,12 +1530,15 @@ class Dwoo_Loader
*/ */
public static function addDirectory($pluginDir) public static function addDirectory($pluginDir)
{ {
$cacheFile = DWOO_COMPILE_DIRECTORY . DIRECTORY_SEPARATOR . 'classpath-'.substr(strtr($pluginDir, ':/\\.', '----'), strlen($pluginDir) > 80 ? -80 : 0).'.cache.php'; if(!isset(self::$paths[$pluginDir]))
self::$paths[] = array($pluginDir, $cacheFile); {
if(file_exists($cacheFile)) $cacheFile = DWOO_COMPILE_DIRECTORY . DIRECTORY_SEPARATOR . 'classpath-'.substr(strtr($pluginDir, ':/\\.', '----'), strlen($pluginDir) > 80 ? -80 : 0).'.cache.php';
include $cacheFile; self::$paths[$pluginDir] = $cacheFile;
else if(file_exists($cacheFile))
Dwoo_Loader::rebuildClassPathCache($pluginDir, $cacheFile); include $cacheFile;
else
Dwoo_Loader::rebuildClassPathCache($pluginDir, $cacheFile);
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment