2
0
Просмотр исходного кода

Zend_Cache: improved cache template options processing. Closes [ZF-9737].

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@21977 44c647ce-9c0f-0410-b52a-842ac1e357ba
alexander 15 лет назад
Родитель
Сommit
476da3124b

+ 8 - 0
documentation/manual/en/module_specs/Zend_Application-AvailableResources-CacheManager.xml

@@ -29,10 +29,13 @@
 
         <programlisting language="ini"><![CDATA[
 resources.cachemanager.database.frontend.name = Core
+resources.cachemanager.database.frontend.customFrontendNaming = false
 resources.cachemanager.database.frontend.options.lifetime = 7200
 resources.cachemanager.database.frontend.options.automatic_serialization = true
 resources.cachemanager.database.backend.name = File
+resources.cachemanager.database.backend.customBackendNaming = false
 resources.cachemanager.database.backend.options.cache_dir = "/path/to/cache"
+resources.cachemanager.database.frontendBackendAutoload = false
 ]]></programlisting>
 
         <para>
@@ -40,5 +43,10 @@ resources.cachemanager.database.backend.options.cache_dir = "/path/to/cache"
             accessing an instance of the Manager and calling
             <command>$cacheManager->getCache('database');</command>.
         </para>
+
+        <para>
+            See <methodname>Zend_Cache::factory()</methodname> method to get default values 
+            description.
+        </para>
     </example>
 </sect2>

+ 7 - 4
library/Zend/Cache/Manager.php

@@ -37,7 +37,7 @@ class Zend_Cache_Manager
      * Constant holding reserved name for default Page Cache
      */
     const PAGECACHE = 'page';
-    
+
     /**
      * Constant holding reserved name for default Page Tag Cache
      */
@@ -160,8 +160,8 @@ class Zend_Cache_Manager
             return $this->_caches[$name];
         }
         if (isset($this->_optionTemplates[$name])) {
-            if ($name == self::PAGECACHE 
-                && (!isset($this->_optionTemplates[$name]['backend']['options']['tag_cache']) 
+            if ($name == self::PAGECACHE
+                && (!isset($this->_optionTemplates[$name]['backend']['options']['tag_cache'])
                 || !$this->_optionTemplates[$name]['backend']['options']['tag_cache'] instanceof Zend_Cache_Core)
             ) {
                 $this->_optionTemplates[$name]['backend']['options']['tag_cache']
@@ -171,7 +171,10 @@ class Zend_Cache_Manager
                 $this->_optionTemplates[$name]['frontend']['name'],
                 $this->_optionTemplates[$name]['backend']['name'],
                 isset($this->_optionTemplates[$name]['frontend']['options']) ? $this->_optionTemplates[$name]['frontend']['options'] : array(),
-                isset($this->_optionTemplates[$name]['backend']['options']) ? $this->_optionTemplates[$name]['backend']['options'] : array()
+                isset($this->_optionTemplates[$name]['backend']['options']) ? $this->_optionTemplates[$name]['backend']['options'] : array(),
+                isset($this->_optionTemplates[$name]['frontend']['customFrontendNaming']) ? $this->_optionTemplates[$name]['frontend']['customFrontendNaming'] : false,
+                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];
         }