diff options
Diffstat (limited to 'libs/Zend/Cache.php')
-rw-r--r-- | libs/Zend/Cache.php | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/libs/Zend/Cache.php b/libs/Zend/Cache.php index 1ea81411d8..761be75e17 100644 --- a/libs/Zend/Cache.php +++ b/libs/Zend/Cache.php @@ -14,15 +14,15 @@ * * @category Zend * @package Zend_Cache - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Cache.php 16200 2009-06-21 18:50:06Z thomas $ + * @version $Id: Cache.php 21974 2010-04-23 17:10:17Z alexander $ */ /** * @package Zend_Cache - * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) + * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License */ abstract class Zend_Cache @@ -40,15 +40,16 @@ abstract class Zend_Cache * * @var array */ - public static $standardBackends = array('File', 'Sqlite', 'Memcached', 'Apc', 'ZendPlatform', 'Xcache', 'TwoLevels'); + public static $standardBackends = array('File', 'Sqlite', 'Memcached', 'Apc', 'ZendPlatform', + 'Xcache', 'TwoLevels', 'ZendServer_Disk', 'ZendServer_ShMem'); /** * Standard backends which implement the ExtendedInterface - * + * * @var array */ public static $standardExtendedBackends = array('File', 'Apc', 'TwoLevels', 'Memcached', 'Sqlite'); - + /** * Only for backward compatibily (may be removed in next major release) * @@ -73,7 +74,7 @@ abstract class Zend_Cache const CLEANING_MODE_MATCHING_TAG = 'matchingTag'; const CLEANING_MODE_NOT_MATCHING_TAG = 'notMatchingTag'; const CLEANING_MODE_MATCHING_ANY_TAG = 'matchingAnyTag'; - + /** * Factory * @@ -83,7 +84,7 @@ abstract class Zend_Cache * @param array $backendOptions associative array of options for the corresponding backend constructor * @param boolean $customFrontendNaming if true, the frontend argument is used as a complete class name ; if false, the frontend argument is used as the end of "Zend_Cache_Frontend_[...]" class name * @param boolean $customBackendNaming if true, the backend argument is used as a complete class name ; if false, the backend argument is used as the end of "Zend_Cache_Backend_[...]" class name - * @param boolean $autoload if true, there will no require_once for backend and frontend (usefull only for custom backends/frontends) + * @param boolean $autoload if true, there will no // require_once for backend and frontend (usefull only for custom backends/frontends) * @throws Zend_Cache_Exception * @return Zend_Cache_Core|Zend_Cache_Frontend */ @@ -110,7 +111,7 @@ abstract class Zend_Cache $frontendObject->setBackend($backendObject); return $frontendObject; } - + /** * Frontend Constructor * @@ -129,7 +130,7 @@ abstract class Zend_Cache // we use a standard backend $backendClass = 'Zend_Cache_Backend_' . $backend; // security controls are explicit - require_once str_replace('_', DIRECTORY_SEPARATOR, $backendClass) . '.php'; + // require_once str_replace('_', DIRECTORY_SEPARATOR, $backendClass) . '.php'; } else { // we use a custom backend if (!preg_match('~^[\w]+$~D', $backend)) { @@ -146,12 +147,12 @@ abstract class Zend_Cache if (!(self::_isReadable($file))) { self::throwException("file $file not found in include_path"); } - require_once $file; + // require_once $file; } } return new $backendClass($backendOptions); } - + /** * Backend Constructor * @@ -171,7 +172,7 @@ abstract class Zend_Cache // For perfs reasons, with frontend == 'Core', we can interact with the Core itself $frontendClass = 'Zend_Cache_' . ($frontend != 'Core' ? 'Frontend_' : '') . $frontend; // security controls are explicit - require_once str_replace('_', DIRECTORY_SEPARATOR, $frontendClass) . '.php'; + // require_once str_replace('_', DIRECTORY_SEPARATOR, $frontendClass) . '.php'; } else { // we use a custom frontend if (!preg_match('~^[\w]+$~D', $frontend)) { @@ -188,7 +189,7 @@ abstract class Zend_Cache if (!(self::_isReadable($file))) { self::throwException("file $file not found in include_path"); } - require_once $file; + // require_once $file; } } return new $frontendClass($frontendOptions); @@ -201,11 +202,11 @@ abstract class Zend_Cache * @param string $msg Message for the exception * @throws Zend_Cache_Exception */ - public static function throwException($msg) + public static function throwException($msg, Exception $e = null) { // For perfs reasons, we use this dynamic inclusion - require_once 'Zend/Cache/Exception.php'; - throw new Zend_Cache_Exception($msg); + // require_once 'Zend/Cache/Exception.php'; + throw new Zend_Cache_Exception($msg, 0, $e); } /** @@ -220,6 +221,10 @@ abstract class Zend_Cache $name = str_replace(array('-', '_', '.'), ' ', $name); $name = ucwords($name); $name = str_replace(' ', '', $name); + if (stripos($name, 'ZendServer') === 0) { + $name = 'ZendServer_' . substr($name, strlen('ZendServer')); + } + return $name; } |