Browse Source

Updated static page cache tag cache, Zend_Cache_Manager::PAGETAGCACHE, handling and fixed tag communication from Zend_Cache_Frontend_Capture

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@20602 44c647ce-9c0f-0410-b52a-842ac1e357ba
padraic 16 years ago
parent
commit
68804514c1

+ 2 - 1
library/Zend/Cache/Frontend/Capture.php

@@ -52,8 +52,9 @@ class Zend_Cache_Frontend_Capture extends Zend_Cache_Core
      * @param  string  $id Cache id
      * @return mixed True if the cache is hit (false else) with $echoData=true (default) ; string else (datas)
      */
-    public function start($id, $tags)
+    public function start($id, array $tags)
     {
+        $this->_tags = $tags;
         ob_start(array($this, '_flush'));
         ob_implicit_flush(false);
         $this->_idStack[] = $id;

+ 8 - 2
library/Zend/Cache/Manager.php

@@ -34,6 +34,11 @@ class Zend_Cache_Manager
      * Constant holding reserved name for default Page Cache
      */
     const PAGECACHE = 'page';
+    
+    /**
+     * Constant holding reserved name for default Page Tag Cache
+     */
+    const PAGETAGCACHE = 'pagetag';
 
     /**
      * Array of caches stored by the Cache Manager instance
@@ -91,11 +96,12 @@ class Zend_Cache_Manager
             ),
         ),
         // Tag Cache
-        'tagcache' => array(
+        'pagetag' => array(
             'frontend' => array(
                 'name'    => 'Core',
                 'options' => array(
                     'automatic_serialization' => true,
+                    'lifetime' => null
                 ),
             ),
             'backend' => array(
@@ -155,7 +161,7 @@ class Zend_Cache_Manager
                 || !$this->_optionTemplates[$name]['backend']['options']['tag_cache'] instanceof Zend_Cache_Core)
             ) {
                 $this->_optionTemplates[$name]['backend']['options']['tag_cache']
-                    = $this->getCache('tagcache');
+                    = $this->getCache(self::PAGETAGCACHE );
             }
             $this->_caches[$name] = Zend_Cache::factory(
                 $this->_optionTemplates[$name]['frontend']['name'],

+ 1 - 1
library/Zend/Controller/Action/Helper/Cache.php

@@ -160,7 +160,7 @@ class Zend_Controller_Action_Helper_Cache
             && !empty($this->_tags[$controller][$action])) {
                 $tags = array_unique($this->_tags[$controller][$action]);
             }
-            $this->getCache('page')->start($this->_encodeCacheId($reqUri), $tags);
+            $this->getCache(Zend_Cache_Manager::PAGECACHE)->start($this->_encodeCacheId($reqUri), $tags);
         }
     }