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

Updated Static-Cache umask default - fixes out-of-box issues on Ubuntu (for example) where the permissions were problematic.

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@20645 44c647ce-9c0f-0410-b52a-842ac1e357ba
padraic 16 лет назад
Родитель
Сommit
14b8359ceb

+ 2 - 2
library/Zend/Cache/Backend/Static.php

@@ -52,7 +52,7 @@ class Zend_Cache_Backend_Static
         'file_extension'   => '.html',
         'index_filename'   => 'index',
         'file_locking'     => true,
-        'cache_file_umask' => 0600,
+        'cache_file_umask' => 0644,
         'debug_header'     => false,
         'tag_cache'        => null,
     );
@@ -254,7 +254,7 @@ class Zend_Cache_Backend_Static
             $fileName = $this->_options['index_filename'];
         }
         $pathName = $this->_options['public_dir'] . dirname($id);
-        $file     = $pathName . '/' . $fileName . $this->_options['file_extension'];
+        $file     = realpath($pathName) . '/' . $fileName . $this->_options['file_extension'];
         if (!file_exists($file)) {
             return false;
         }

+ 1 - 0
library/Zend/Cache/Manager.php

@@ -108,6 +108,7 @@ class Zend_Cache_Manager
                 'name'    => 'File',
                 'options' => array(
                     'cache_dir' => '../cache',
+                    'cache_file_umask' => 0644
                 ),
             ),
         ),

+ 7 - 4
library/Zend/Controller/Action/Helper/Cache.php

@@ -115,9 +115,11 @@ class Zend_Controller_Action_Helper_Cache
     public function removePage($relativeUrl, $recursive = false)
     {
         if ($recursive) {
-            return $this->getCache('page')->removeRecursive($relativeUrl);
+            return $this->getCache(Zend_Cache_Manager::PAGECACHE)
+                ->getBackend()->removeRecursive($relativeUrl);
         } else {
-            return $this->getCache('page')->remove($relativeUrl);
+            return $this->getCache(Zend_Cache_Manager::PAGECACHE)
+                ->getBackend()->remove($relativeUrl);
         }
     }
 
@@ -132,7 +134,7 @@ class Zend_Controller_Action_Helper_Cache
      */
     public function removePagesTagged(array $tags)
     {
-        return $this->getCache('page')
+        return $this->getCache(Zend_Cache_Manager::PAGECACHE)
             ->clean(Zend_Cache::CLEANING_MODE_MATCHING_ANY_TAG, $tags);
     }
 
@@ -160,7 +162,8 @@ class Zend_Controller_Action_Helper_Cache
             && !empty($this->_tags[$controller][$action])) {
                 $tags = array_unique($this->_tags[$controller][$action]);
             }
-            $this->getCache(Zend_Cache_Manager::PAGECACHE)->start($this->_encodeCacheId($reqUri), $tags);
+            $this->getCache(Zend_Cache_Manager::PAGECACHE)
+                ->start($this->_encodeCacheId($reqUri), $tags);
         }
     }