Sfoglia il codice sorgente

Added disable_caching flag option to Static Backend cache to disable caching via configuration options (useful for testing/development)

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@20647 44c647ce-9c0f-0410-b52a-842ac1e357ba
padraic 16 anni fa
parent
commit
96b1ef2b8b
1 ha cambiato i file con 4 aggiunte e 0 eliminazioni
  1. 4 0
      library/Zend/Cache/Backend/Static.php

+ 4 - 0
library/Zend/Cache/Backend/Static.php

@@ -55,6 +55,7 @@ class Zend_Cache_Backend_Static
         'cache_file_umask' => 0644,
         'debug_header'     => false,
         'tag_cache'        => null,
+        'disable_caching'  => false
     );
 
     /**
@@ -180,6 +181,9 @@ class Zend_Cache_Backend_Static
      */
     public function save($data, $id, $tags = array(), $specificLifetime = false)
     {
+        if ($this->_options['disable_caching']) {
+            return true;
+        }
         clearstatcache();
         if (is_null($id) || strlen($id) == 0) {
             $id = $this->_detectId();