|
static | factory ($frontend, $backend, $frontendOptions=array(), $backendOptions=array(), $customFrontendNaming=false, $customBackendNaming=false, $autoload=false) |
|
static | _makeBackend ($backend, $backendOptions, $customBackendNaming=false, $autoload=false) |
|
static | _makeFrontend ($frontend, $frontendOptions=array(), $customFrontendNaming=false, $autoload=false) |
|
static | throwException ($msg, Exception $e=null) |
|
|
static | $standardFrontends = array('Core', 'Output', 'Class', 'File', 'Function', 'Page') |
|
static | $standardBackends |
|
static | $standardExtendedBackends = array('File', 'Apc', 'TwoLevels', 'Memcached', 'Libmemcached', 'Sqlite', 'WinCache') |
|
static | $availableFrontends = array('Core', 'Output', 'Class', 'File', 'Function', 'Page') |
|
static | $availableBackends = array('File', 'Sqlite', 'Memcached', 'Libmemcached', 'Apc', 'ZendPlatform', 'Xcache', 'WinCache', 'TwoLevels') |
|
Definition at line 28 of file Cache.php.
◆ _makeBackend()
static _makeBackend |
( |
|
$backend, |
|
|
|
$backendOptions, |
|
|
|
$customBackendNaming = false , |
|
|
|
$autoload = false |
|
) |
| |
|
static |
Backend Constructor
- Parameters
-
string | $backend | |
array | $backendOptions | |
boolean | $customBackendNaming | |
boolean | $autoload | |
- Returns
- Zend_Cache_Backend
Definition at line 124 of file Cache.php.
126 if (!$customBackendNaming) {
131 $backendClass =
'Zend_Cache_Backend_' . $backend;
133 #require_once str_replace('_', DIRECTORY_SEPARATOR, $backendClass) . '.php'; 136 if (!preg_match(
'~^[\w\\\\]+$~D', $backend)) {
139 if (!$customBackendNaming) {
141 $backendClass =
'Zend_Cache_Backend_' . $backend;
143 $backendClass = $backend;
146 $file = str_replace(
'_', DIRECTORY_SEPARATOR, $backendClass) .
'.php';
147 if (!(self::_isReadable($file))) {
153 return new $backendClass($backendOptions);
static throwException($msg, Exception $e=null)
static _normalizeName($name)
◆ _makeFrontend()
static _makeFrontend |
( |
|
$frontend, |
|
|
|
$frontendOptions = array() , |
|
|
|
$customFrontendNaming = false , |
|
|
|
$autoload = false |
|
) |
| |
|
static |
Frontend Constructor
- Parameters
-
string | $frontend | |
array | $frontendOptions | |
boolean | $customFrontendNaming | |
boolean | $autoload | |
- Returns
- Zend_Cache_Core|Zend_Cache_Frontend
Definition at line 165 of file Cache.php.
167 if (!$customFrontendNaming) {
170 if (in_array($frontend, self::$standardFrontends)) {
173 $frontendClass =
'Zend_Cache_' . ($frontend !=
'Core' ?
'Frontend_' :
'') . $frontend;
175 #require_once str_replace('_', DIRECTORY_SEPARATOR, $frontendClass) . '.php'; 178 if (!preg_match(
'~^[\w\\\\]+$~D', $frontend)) {
181 if (!$customFrontendNaming) {
183 $frontendClass =
'Zend_Cache_Frontend_' . $frontend;
185 $frontendClass = $frontend;
188 $file = str_replace(
'_', DIRECTORY_SEPARATOR, $frontendClass) .
'.php';
189 if (!(self::_isReadable($file))) {
195 return new $frontendClass($frontendOptions);
static throwException($msg, Exception $e=null)
static _normalizeName($name)
◆ _normalizeName()
static _normalizeName |
( |
|
$name | ) |
|
|
staticprotected |
Normalize frontend and backend names to allow multiple words TitleCased
- Parameters
-
string | $name | Name to normalize |
- Returns
- string
Definition at line 218 of file Cache.php.
221 $name = str_replace(array(
'-',
'_',
'.'),
' ',
$name);
224 if (stripos(
$name,
'ZendServer') === 0) {
225 $name =
'ZendServer_' . substr(
$name, strlen(
'ZendServer'));
if(!isset($_GET['name'])) $name
◆ factory()
static factory |
( |
|
$frontend, |
|
|
|
$backend, |
|
|
|
$frontendOptions = array() , |
|
|
|
$backendOptions = array() , |
|
|
|
$customFrontendNaming = false , |
|
|
|
$customBackendNaming = false , |
|
|
|
$autoload = false |
|
) |
| |
|
static |
Factory
- Parameters
-
mixed | $frontend | frontend name (string) or Zend_Cache_Frontend_ object |
mixed | $backend | backend name (string) or Zend_Cache_Backend_ object |
array | $frontendOptions | associative array of options for the corresponding frontend constructor |
array | $backendOptions | associative array of options for the corresponding backend constructor |
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 |
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 |
boolean | $autoload | if true, there will no require_once for backend and frontend (useful only for custom backends/frontends) |
- Exceptions
-
- Returns
- Zend_Cache_Core|Zend_Cache_Frontend
Definition at line 91 of file Cache.php.
93 if (is_string($backend)) {
94 $backendObject =
self::_makeBackend($backend, $backendOptions, $customBackendNaming, $autoload);
96 if ((is_object($backend)) && (in_array(
'Zend_Cache_Backend_Interface', class_implements($backend)))) {
97 $backendObject = $backend;
99 self::throwException(
'backend must be a backend name (string) or an object which implements Zend_Cache_Backend_Interface');
102 if (is_string($frontend)) {
103 $frontendObject =
self::_makeFrontend($frontend, $frontendOptions, $customFrontendNaming, $autoload);
105 if (is_object($frontend)) {
106 $frontendObject = $frontend;
111 $frontendObject->setBackend($backendObject);
112 return $frontendObject;
static _makeFrontend($frontend, $frontendOptions=array(), $customFrontendNaming=false, $autoload=false)
static throwException($msg, Exception $e=null)
static _makeBackend($backend, $backendOptions, $customBackendNaming=false, $autoload=false)
◆ throwException()
static throwException |
( |
|
$msg, |
|
|
Exception |
$e = null |
|
) |
| |
|
static |
Throw an exception
Note : for perf reasons, the "load" of Zend/Cache/Exception is dynamic
- Parameters
-
string | $msg | Message for the exception |
- Exceptions
-
Definition at line 205 of file Cache.php.
208 #require_once 'Zend/Cache/Exception.php';
◆ $availableBackends
$availableBackends = array('File', 'Sqlite', 'Memcached', 'Libmemcached', 'Apc', 'ZendPlatform', 'Xcache', 'WinCache', 'TwoLevels') |
|
static |
◆ $availableFrontends
$availableFrontends = array('Core', 'Output', 'Class', 'File', 'Function', 'Page') |
|
static |
◆ $standardBackends
Initial value:= array('File', 'Sqlite', 'Memcached', 'Libmemcached', 'Apc', 'ZendPlatform',
'Xcache', 'TwoLevels', 'WinCache', 'ZendServer_Disk', 'ZendServer_ShMem')
Definition at line 43 of file Cache.php.
◆ $standardExtendedBackends
$standardExtendedBackends = array('File', 'Apc', 'TwoLevels', 'Memcached', 'Libmemcached', 'Sqlite', 'WinCache') |
|
static |
◆ $standardFrontends
$standardFrontends = array('Core', 'Output', 'Class', 'File', 'Function', 'Page') |
|
static |
◆ CLEANING_MODE_ALL
const CLEANING_MODE_ALL = 'all' |
Consts for clean() method
Definition at line 72 of file Cache.php.
◆ CLEANING_MODE_MATCHING_ANY_TAG
const CLEANING_MODE_MATCHING_ANY_TAG = 'matchingAnyTag' |
◆ CLEANING_MODE_MATCHING_TAG
const CLEANING_MODE_MATCHING_TAG = 'matchingTag' |
◆ CLEANING_MODE_NOT_MATCHING_TAG
const CLEANING_MODE_NOT_MATCHING_TAG = 'notMatchingTag' |
◆ CLEANING_MODE_OLD
const CLEANING_MODE_OLD = 'old' |
The documentation for this class was generated from the following file:
- vendor/magento/zendframework1/library/Zend/Cache.php