瀏覽代碼

Fixes #427 - Setting cache options problems

Frank Brückner 11 年之前
父節點
當前提交
901da6b34d

+ 1 - 1
library/Zend/Cache/Backend.php

@@ -61,7 +61,7 @@ class Zend_Cache_Backend
      */
     public function __construct(array $options = array())
     {
-        while (list($name, $value) = each($options)) {
+        foreach ($options as $name => $value) {
             $this->setOption($name, $value);
         }
     }

+ 2 - 2
library/Zend/Cache/Core.php

@@ -143,7 +143,7 @@ class Zend_Cache_Core
             Zend_Cache::throwException("Options passed were not an array"
             . " or Zend_Config instance.");
         }
-        while (list($name, $value) = each($options)) {
+        foreach ($options as $name => $value) {
             $this->setOption($name, $value);
         }
         $this->_loggerSanity();
@@ -158,7 +158,7 @@ class Zend_Cache_Core
     public function setConfig(Zend_Config $config)
     {
         $options = $config->toArray();
-        while (list($name, $value) = each($options)) {
+        foreach ($options as $name => $value) {
             $this->setOption($name, $value);
         }
         return $this;

+ 1 - 1
library/Zend/Cache/Frontend/Class.php

@@ -106,7 +106,7 @@ class Zend_Cache_Frontend_Class extends Zend_Cache_Core
      */
     public function __construct(array $options = array())
     {
-        while (list($name, $value) = each($options)) {
+        foreach ($options as $name => $value) {
             $this->setOption($name, $value);
         }
         if ($this->_specificOptions['cached_entity'] === null) {

+ 1 - 1
library/Zend/Cache/Frontend/File.php

@@ -88,7 +88,7 @@ class Zend_Cache_Frontend_File extends Zend_Cache_Core
      */
     public function __construct(array $options = array())
     {
-        while (list($name, $value) = each($options)) {
+        foreach ($options as $name => $value) {
             $this->setOption($name, $value);
         }
         if (!isset($this->_specificOptions['master_files'])) {

+ 1 - 1
library/Zend/Cache/Frontend/Function.php

@@ -63,7 +63,7 @@ class Zend_Cache_Frontend_Function extends Zend_Cache_Core
      */
     public function __construct(array $options = array())
     {
-        while (list($name, $value) = each($options)) {
+        foreach ($options as $name => $value) {
             $this->setOption($name, $value);
         }
         $this->setOption('automatic_serialization', true);

+ 1 - 1
library/Zend/Cache/Frontend/Page.php

@@ -129,7 +129,7 @@ class Zend_Cache_Frontend_Page extends Zend_Cache_Core
      */
     public function __construct(array $options = array())
     {
-        while (list($name, $value) = each($options)) {
+        foreach ($options as $name => $value) {
             $name = strtolower($name);
             switch ($name) {
                 case 'regexps':