Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libs/Zend/Cache/Backend/File.php')
-rw-r--r--libs/Zend/Cache/Backend/File.php25
1 files changed, 16 insertions, 9 deletions
diff --git a/libs/Zend/Cache/Backend/File.php b/libs/Zend/Cache/Backend/File.php
index 51e2697ad9..eeddfa5b80 100644
--- a/libs/Zend/Cache/Backend/File.php
+++ b/libs/Zend/Cache/Backend/File.php
@@ -15,26 +15,26 @@
* @category Zend
* @package Zend_Cache
* @subpackage Zend_Cache_Backend
- * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
- * @version $Id: File.php 17868 2009-08-28 09:46:30Z yoshida@zend.co.jp $
+ * @version $Id: File.php 21642 2010-03-25 17:07:02Z mabe $
*/
/**
* @see Zend_Cache_Backend_Interface
*/
-require_once 'Zend/Cache/Backend/ExtendedInterface.php';
+// require_once 'Zend/Cache/Backend/ExtendedInterface.php';
/**
* @see Zend_Cache_Backend
*/
-require_once 'Zend/Cache/Backend.php';
+// require_once 'Zend/Cache/Backend.php';
/**
* @package Zend_Cache
* @subpackage Zend_Cache_Backend
- * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
+ * @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_Backend_ExtendedInterface
@@ -123,8 +123,8 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
$this->setCacheDir(self::getTmpDir() . DIRECTORY_SEPARATOR, false);
}
if (isset($this->_options['file_name_prefix'])) { // particular case for this option
- if (!preg_match('~^[\w]+$~', $this->_options['file_name_prefix'])) {
- Zend_Cache::throwException('Invalid file_name_prefix : must use only [a-zA-A0-9_]');
+ if (!preg_match('~^[a-zA-Z0-9_]+$~D', $this->_options['file_name_prefix'])) {
+ Zend_Cache::throwException('Invalid file_name_prefix : must use only [a-zA-Z0-9_]');
}
}
if ($this->_options['metadatas_array_max_size'] < 10) {
@@ -647,6 +647,7 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
$prefix = $this->_options['file_name_prefix'];
$glob = @glob($dir . $prefix . '--*');
if ($glob === false) {
+ // On some systems it is impossible to distinguish between empty match and an error.
return true;
}
foreach ($glob as $file) {
@@ -739,7 +740,8 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
$prefix = $this->_options['file_name_prefix'];
$glob = @glob($dir . $prefix . '--*');
if ($glob === false) {
- return true;
+ // On some systems it is impossible to distinguish between empty match and an error.
+ return array();
}
foreach ($glob as $file) {
if (is_file($file)) {
@@ -802,7 +804,12 @@ class Zend_Cache_Backend_File extends Zend_Cache_Backend implements Zend_Cache_B
}
if ((is_dir($file)) and ($this->_options['hashed_directory_level']>0)) {
// Recursive call
- $result = array_unique(array_merge($result, $this->_get($file . DIRECTORY_SEPARATOR, $mode, $tags)));
+ $recursiveRs = $this->_get($file . DIRECTORY_SEPARATOR, $mode, $tags);
+ if ($recursiveRs === false) {
+ $this->_log('Zend_Cache_Backend_File::_get() / recursive call : can\'t list entries of "'.$file.'"');
+ } else {
+ $result = array_unique(array_merge($result, $recursiveRs));
+ }
}
}
return array_unique($result);