diff -r 5a6b6e770365 -r 68c69c656a2c web/lib/Zend/Loader/PluginLoader.php --- a/web/lib/Zend/Loader/PluginLoader.php Thu May 07 15:10:09 2015 +0200 +++ b/web/lib/Zend/Loader/PluginLoader.php Thu May 07 15:16:02 2015 +0200 @@ -15,9 +15,9 @@ * @category Zend * @package Zend_Loader * @subpackage PluginLoader - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: PluginLoader.php 24877 2012-06-04 14:04:53Z adamlundrigan $ + * @version $Id$ */ /** Zend_Loader_PluginLoader_Interface */ @@ -32,7 +32,7 @@ * @category Zend * @package Zend_Loader * @subpackage PluginLoader - * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ class Zend_Loader_PluginLoader implements Zend_Loader_PluginLoader_Interface @@ -44,6 +44,12 @@ protected static $_includeFileCache; /** + * Class map cache file handler + * @var resource + */ + protected static $_includeFileCacheHandler; + + /** * Instance loaded plugin paths * * @var array @@ -128,7 +134,13 @@ } $nsSeparator = (false !== strpos($prefix, '\\'))?'\\':'_'; - return rtrim($prefix, $nsSeparator) . $nsSeparator; + $prefix = rtrim($prefix, $nsSeparator) . $nsSeparator; + //if $nsSeprator == "\" and the prefix ends in "_\" remove trailing \ + //https://github.com/zendframework/zf1/issues/152 + if(($nsSeparator == "\\") && (substr($prefix,-2) == "_\\")) { + $prefix = substr($prefix, 0, -1); + } + return $prefix; } /** @@ -432,6 +444,13 @@ */ 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; @@ -471,14 +490,17 @@ */ protected static function _appendIncFile($incFile) { - if (!file_exists(self::$_includeFileCache)) { - $file = '\n"; + fwrite(self::$_includeFileCacheHandler, $line, strlen($line)); } } }