Commit 8b28f80b by Seldaek

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

parent 994b3c87
......@@ -1502,16 +1502,17 @@ class DwooLoader
/**
* adds a plugin directory
*
* @param string $dir the plugin path to scan
* @param string $pluginDir the plugin path to scan
* @param string $cacheDir the directory where the classpath cache is written, it must be writeable and will default to /path/to/Dwoo/cache if not provided
*/
public static function addDirectory($dir)
public static function addDirectory($pluginDir, $cacheDir = null)
{
$cacheFile = DWOO_PATH.'cache'.DIRECTORY_SEPARATOR.'classpath-'.strtr($dir, '/\\.', '---').'.cache';
self::$paths[] = array($dir, $cacheFile);
$cacheFile = ($cacheDir === null ? DWOO_PATH.'cache' : $cacheDir).DIRECTORY_SEPARATOR.'classpath-'.strtr($pluginDir, '/\\.', '---').'.cache';
self::$paths[] = array($pluginDir, $cacheFile);
if(file_exists($cacheFile))
include $cacheFile;
else
DwooLoader::rebuildClassPathCache($dir, $cacheFile);
DwooLoader::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