Skip to content
This repository has been archived by the owner on Jun 10, 2019. It is now read-only.

PHP7.2 Zend_Cache_Backend #142

Open
Nuranto opened this issue Jun 14, 2018 · 1 comment
Open

PHP7.2 Zend_Cache_Backend #142

Nuranto opened this issue Jun 14, 2018 · 1 comment

Comments

@Nuranto
Copy link

Nuranto commented Jun 14, 2018

'function' => string(20) "mageCoreErrorHandler" 'args' => array(5) { [0] => int(8192) [1] => string(83) "The each() function is deprecated. This message will be suppressed on further calls" [2] => string(40) "/opt/shop-app/lib/Zend/Cache/Backend.php" [3] => int(79) [4] => array(1) { ... }

@EricSeastrand
Copy link

We hacked a fix into the core file, but obviously this is not an ideal solution for upgradability. Not sure what the best path is for future compatibility.

--- lib/Zend/Cache/Backend.php	(revision 930)
+++ lib/Zend/Cache/Backend.php	(revision 931)
@@ -76,6 +76,17 @@
     public function setDirectives($directives)
     {
         if (!is_array($directives)) Zend_Cache::throwException('Directives parameter must be an array');
+        // Core hack to fix notice: Deprecated functionality: The each() function is deprecated. This message will be suppressed on further calls  in /mnt/www//lib/Zend/Cache/Backend.php on line 79
+        foreach($directives as $name => $value) {
+            if (!is_string($name)) {
+                Zend_Cache::throwException("Incorrect option name : $name");
+            }
+            $name = strtolower($name);
+            if (array_key_exists($name, $this->_directives)) {
+                $this->_directives[$name] = $value;
+            }
+        }
+        /*
         while (list($name, $value) = each($directives)) {
             if (!is_string($name)) {
                 Zend_Cache::throwException("Incorrect option name : $name");
@@ -86,6 +97,7 @@
             }
 
         }
+        */
 
         $this->_loggerSanity();
     }

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants