diff --git a/libs/Zend/Cache/Backend.php b/libs/Zend/Cache/Backend.php index 3ec7c5f2625234335349a1f5d26438c9309913aa..8985ed0412c41574f0b9486e87943f8c779bcbb2 100644 --- a/libs/Zend/Cache/Backend.php +++ b/libs/Zend/Cache/Backend.php @@ -17,7 +17,7 @@ * @subpackage Zend_Cache_Backend * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Backend.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: Backend.php 23800 2011-03-10 20:52:08Z mabe $ */ @@ -237,7 +237,9 @@ class Zend_Cache_Backend // Create a default logger to the standard output stream // require_once 'Zend/Log.php'; // require_once 'Zend/Log/Writer/Stream.php'; + // require_once 'Zend/Log/Filter/Priority.php'; $logger = new Zend_Log(new Zend_Log_Writer_Stream('php://output')); + $logger->addFilter(new Zend_Log_Filter_Priority(Zend_Log::WARN, '<=')); $this->_directives['logger'] = $logger; } diff --git a/libs/Zend/Cache/Core.php b/libs/Zend/Cache/Core.php index 2fa686806c9c42166db64cc2430b6947319b22cf..cc1fd8f4231eed62525e7f444d0a48dbed640bd8 100644 --- a/libs/Zend/Cache/Core.php +++ b/libs/Zend/Cache/Core.php @@ -16,7 +16,7 @@ * @package Zend_Cache * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Core.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: Core.php 23800 2011-03-10 20:52:08Z mabe $ */ @@ -300,6 +300,8 @@ class Zend_Cache_Core $id = $this->_id($id); // cache id may need prefix $this->_lastId = $id; self::_validateIdOrTag($id); + + $this->_log("Zend_Cache_Core: load item '{$id}'", 7); $data = $this->_backend->load($id, $doNotTestCacheValidity); if ($data===false) { // no cache available @@ -326,6 +328,8 @@ class Zend_Cache_Core $id = $this->_id($id); // cache id may need prefix self::_validateIdOrTag($id); $this->_lastId = $id; + + $this->_log("Zend_Cache_Core: test item '{$id}'", 7); return $this->_backend->test($id); } @@ -360,27 +364,22 @@ class Zend_Cache_Core Zend_Cache::throwException("Datas must be string or set automatic_serialization = true"); } } + // automatic cleaning if ($this->_options['automatic_cleaning_factor'] > 0) { $rand = rand(1, $this->_options['automatic_cleaning_factor']); if ($rand==1) { - if ($this->_extendedBackend) { - // New way - if ($this->_backendCapabilities['automatic_cleaning']) { - $this->clean(Zend_Cache::CLEANING_MODE_OLD); - } else { - $this->_log('Zend_Cache_Core::save() / automatic cleaning is not available/necessary with this backend'); - } + // new way || deprecated way + if ($this->_extendedBackend || method_exists($this->_backend, 'isAutomaticCleaningAvailable')) { + $this->_log("Zend_Cache_Core::save(): automatic cleaning running", 7); + $this->clean(Zend_Cache::CLEANING_MODE_OLD); } else { - // Deprecated way (will be removed in next major version) - if (method_exists($this->_backend, 'isAutomaticCleaningAvailable') && ($this->_backend->isAutomaticCleaningAvailable())) { - $this->clean(Zend_Cache::CLEANING_MODE_OLD); - } else { - $this->_log('Zend_Cache_Core::save() / automatic cleaning is not available/necessary with this backend'); - } + $this->_log("Zend_Cache_Core::save(): automatic cleaning is not available/necessary with current backend", 4); } } } + + $this->_log("Zend_Cache_Core: save item '{$id}'", 7); if ($this->_options['ignore_user_abort']) { $abort = ignore_user_abort(true); } @@ -392,22 +391,23 @@ class Zend_Cache_Core if ($this->_options['ignore_user_abort']) { ignore_user_abort($abort); } + if (!$result) { // maybe the cache is corrupted, so we remove it ! - if ($this->_options['logging']) { - $this->_log("Zend_Cache_Core::save() : impossible to save cache (id=$id)"); - } + $this->_log("Zend_Cache_Core::save(): failed to save item '{$id}' -> removing it", 4); $this->_backend->remove($id); return false; } + if ($this->_options['write_control']) { $data2 = $this->_backend->load($id, true); if ($data!=$data2) { - $this->_log('Zend_Cache_Core::save() / write_control : written and read data do not match'); + $this->_log("Zend_Cache_Core::save(): write control of item '{$id}' failed -> removing it", 4); $this->_backend->remove($id); return false; } } + return true; } @@ -424,6 +424,8 @@ class Zend_Cache_Core } $id = $this->_id($id); // cache id may need prefix self::_validateIdOrTag($id); + + $this->_log("Zend_Cache_Core: remove item '{$id}'", 7); return $this->_backend->remove($id); } @@ -458,6 +460,7 @@ class Zend_Cache_Core Zend_Cache::throwException('Invalid cleaning mode'); } self::_validateTagsArray($tags); + return $this->_backend->clean($mode, $tags); } @@ -649,6 +652,8 @@ class Zend_Cache_Core Zend_Cache::throwException(self::BACKEND_NOT_IMPLEMENTS_EXTENDED_IF); } $id = $this->_id($id); // cache id may need prefix + + $this->_log("Zend_Cache_Core: touch item '{$id}'", 7); return $this->_backend->touch($id, $extraLifetime); } @@ -713,9 +718,11 @@ class Zend_Cache_Core } // Create a default logger to the standard output stream - // require_once 'Zend/Log/Writer/Stream.php'; // require_once 'Zend/Log.php'; + // require_once 'Zend/Log/Writer/Stream.php'; + // require_once 'Zend/Log/Filter/Priority.php'; $logger = new Zend_Log(new Zend_Log_Writer_Stream('php://output')); + $logger->addFilter(new Zend_Log_Filter_Priority(Zend_Log::WARN, '<=')); $this->_options['logger'] = $logger; } diff --git a/libs/Zend/Cache/Frontend/File.php b/libs/Zend/Cache/Frontend/File.php index e3d170bdd3d3eac84c04445b192c12d9dd09a37c..fe55dc7383c95555323a03ff6d11816cb2745bb8 100644 --- a/libs/Zend/Cache/Frontend/File.php +++ b/libs/Zend/Cache/Frontend/File.php @@ -17,7 +17,7 @@ * @subpackage Zend_Cache_Frontend * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: File.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: File.php 23793 2011-03-02 22:31:05Z mabe $ */ @@ -110,7 +110,11 @@ class Zend_Cache_Frontend_File extends Zend_Cache_Core clearstatcache(); $i = 0; foreach ($masterFiles as $masterFile) { - $mtime = @filemtime($masterFile); + if (file_exists($masterFile)) { + $mtime = filemtime($masterFile); + } else { + $mtime = false; + } if (!$this->_specificOptions['ignore_missing_master_files'] && !$mtime) { Zend_Cache::throwException('Unable to read master_file : ' . $masterFile); diff --git a/libs/Zend/Config/Yaml.php b/libs/Zend/Config/Yaml.php index 0cc48a1f46b71d1835c724882c670540cfc838df..440465b4361c92070ddd048591064c2e9b1752dc 100755 --- a/libs/Zend/Config/Yaml.php +++ b/libs/Zend/Config/Yaml.php @@ -16,7 +16,7 @@ * @package Zend_Config * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Yaml.php 23775 2011-03-01 17:25:24Z ralph $ + * @version $Id: Yaml.php 23808 2011-03-16 21:26:56Z matthew $ */ /** @@ -284,7 +284,7 @@ class Zend_Config_Yaml extends Zend_Config $config = array(); $inIndent = false; while (list($n, $line) = each($lines)) { - $lineno = $n+1; + $lineno = $n + 1; if (strlen($line) == 0) { continue; } @@ -313,7 +313,7 @@ class Zend_Config_Yaml extends Zend_Config if (preg_match("/(\w+):\s*(.*)/", $line, $m)) { // key: value - if ($m[2]) { + if (strlen($m[2])) { // simple key: value $value = $m[2]; // Check for booleans and constants diff --git a/libs/Zend/Version.php b/libs/Zend/Version.php index c09bdb22cf73b3bcb0efd5b8387983aefe694c62..5e815224eeb9e433bc705240152de8221c6e12f2 100644 --- a/libs/Zend/Version.php +++ b/libs/Zend/Version.php @@ -16,7 +16,7 @@ * @package Zend_Version * @copyright Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License - * @version $Id: Version.php 23780 2011-03-01 21:23:36Z matthew $ + * @version $Id: Version.php 23849 2011-04-06 15:23:21Z matthew $ */ /** @@ -32,7 +32,7 @@ final class Zend_Version /** * Zend Framework version identification - see compareVersion() */ - const VERSION = '1.11.4'; + const VERSION = '1.11.5'; /** * The latest stable version Zend Framework available