|
|
@@ -57,17 +57,6 @@ class Zend_Cache_Manager
|
|
|
* @var array
|
|
|
*/
|
|
|
protected $_optionTemplates = array(
|
|
|
- // Null Cache (Enforce Null/Empty Values)
|
|
|
- 'skeleton' => array(
|
|
|
- 'frontend' => array(
|
|
|
- 'name' => null,
|
|
|
- 'options' => array(),
|
|
|
- ),
|
|
|
- 'backend' => array(
|
|
|
- 'name' => null,
|
|
|
- 'options' => array(),
|
|
|
- ),
|
|
|
- ),
|
|
|
// Simple Common Default
|
|
|
'default' => array(
|
|
|
'frontend' => array(
|
|
|
@@ -79,10 +68,12 @@ class Zend_Cache_Manager
|
|
|
'backend' => array(
|
|
|
'name' => 'File',
|
|
|
'options' => array(
|
|
|
- 'cache_dir' => '../cache',
|
|
|
+ // use system temp dir by default of file backend
|
|
|
+ // 'cache_dir' => '../cache',
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
+
|
|
|
// Static Page HTML Cache
|
|
|
'page' => array(
|
|
|
'frontend' => array(
|
|
|
@@ -98,6 +89,7 @@ class Zend_Cache_Manager
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
+
|
|
|
// Tag Cache
|
|
|
'pagetag' => array(
|
|
|
'frontend' => array(
|
|
|
@@ -110,8 +102,10 @@ class Zend_Cache_Manager
|
|
|
'backend' => array(
|
|
|
'name' => 'File',
|
|
|
'options' => array(
|
|
|
- 'cache_dir' => '../cache',
|
|
|
- 'cache_file_umask' => 0644
|
|
|
+ // use system temp dir by default of file backend
|
|
|
+ // 'cache_dir' => '../cache',
|
|
|
+ // use default umask of file backend
|
|
|
+ // 'cache_file_umask' => 0644
|
|
|
),
|
|
|
),
|
|
|
),
|
|
|
@@ -167,6 +161,7 @@ class Zend_Cache_Manager
|
|
|
$this->_optionTemplates[$name]['backend']['options']['tag_cache']
|
|
|
= $this->getCache(self::PAGETAGCACHE);
|
|
|
}
|
|
|
+
|
|
|
$this->_caches[$name] = Zend_Cache::factory(
|
|
|
$this->_optionTemplates[$name]['frontend']['name'],
|
|
|
$this->_optionTemplates[$name]['backend']['name'],
|
|
|
@@ -176,11 +171,28 @@ class Zend_Cache_Manager
|
|
|
isset($this->_optionTemplates[$name]['backend']['customBackendNaming']) ? $this->_optionTemplates[$name]['backend']['customBackendNaming'] : false,
|
|
|
isset($this->_optionTemplates[$name]['frontendBackendAutoload']) ? $this->_optionTemplates[$name]['frontendBackendAutoload'] : false
|
|
|
);
|
|
|
+
|
|
|
return $this->_caches[$name];
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
+ * Fetch all available caches
|
|
|
+ *
|
|
|
+ * @return array An array of all available caches with it's names as key
|
|
|
+ */
|
|
|
+ public function getCaches()
|
|
|
+ {
|
|
|
+ $caches = $this->_caches;
|
|
|
+ foreach ($this->_optionTemplates as $name => $tmp) {
|
|
|
+ if (!isset($caches[$name])) {
|
|
|
+ $caches[$name] = $this->getCache($name);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return $caches;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
* Set a named configuration template from which a cache object can later
|
|
|
* be lazy loaded
|
|
|
*
|