diff --git a/library/Zend/Loader/PluginLoader.php b/library/Zend/Loader/PluginLoader.php index 8b09205a5f..0e51a9d08f 100644 --- a/library/Zend/Loader/PluginLoader.php +++ b/library/Zend/Loader/PluginLoader.php @@ -43,6 +43,12 @@ class Zend_Loader_PluginLoader implements Zend_Loader_PluginLoader_Interface */ protected static $_includeFileCache; + /** + * Class map cache file handler + * @var resource + */ + protected static $_includeFileCacheHandler; + /** * Instance loaded plugin paths * @@ -438,6 +444,13 @@ public function load($name, $throwExceptions = true) */ public static function setIncludeFileCache($file) { + if (!empty(self::$_includeFileCacheHandler)) { + flock(self::$_includeFileCacheHandler, LOCK_UN); + fclose(self::$_includeFileCacheHandler); + } + + self::$_includeFileCacheHandler = null; + if (null === $file) { self::$_includeFileCache = null; return; @@ -477,14 +490,17 @@ public static function getIncludeFileCache() */ protected static function _appendIncFile($incFile) { - if (!file_exists(self::$_includeFileCache)) { - $file = '\n"; + fwrite(self::$_includeFileCacheHandler, $line, strlen($line)); } } }