Forráskód Böngészése

ZF-9970: fixed BC break: use the old private method "_makeId" to call the new public method "makeId"

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@22648 44c647ce-9c0f-0410-b52a-842ac1e357ba
mabe 15 éve
szülő
commit
e50f974c68

+ 14 - 4
library/Zend/Cache/Frontend/Class.php

@@ -230,15 +230,25 @@ class Zend_Cache_Frontend_Class extends Zend_Cache_Core
     }
 
     /**
+     * ZF-9970
+     *
+     * @deprecated
+     */
+    private function _makeId($name, $args)
+    {
+        return $this->makeId($name, $args);
+    }
+
+    /**
      * Make a cache id from the method name and parameters
      *
-     * @param  string $name       Method name
-     * @param  array  $parameters Method parameters
+     * @param  string $name Method name
+     * @param  array  $args Method parameters
      * @return string Cache id
      */
-    public function makeId($name, $parameters)
+    public function makeId($name, array $args = array())
     {
-        return md5($this->_cachedEntityLabel . '__' . $name . '__' . serialize($parameters));
+        return md5($this->_cachedEntityLabel . '__' . $name . '__' . serialize($args));
     }
 
 }

+ 13 - 3
library/Zend/Cache/Frontend/Function.php

@@ -94,7 +94,7 @@ class Zend_Cache_Frontend_Function extends Zend_Cache_Core
             return call_user_func_array($callback, $parameters);
         }
 
-        $id = $this->makeId($callback, $parameters);
+        $id = $this->_makeId($callback, $parameters);
         if ( ($rs = $this->load($id)) && isset($rs[0], $rs[1])) {
             // A cache is available
             $output = $rs[0];
@@ -115,14 +115,24 @@ class Zend_Cache_Frontend_Function extends Zend_Cache_Core
     }
 
     /**
+     * ZF-9970
+     *
+     * @deprecated
+     */
+    private function _makeId($callback, array $args)
+    {
+        return $this->makeId($callback, $args);
+    }
+
+    /**
      * Make a cache id from the function name and parameters
      *
      * @param  callback $callback A valid callback
-     * @param  array  $parameters Function parameters
+     * @param  array    $args     Function parameters
      * @throws Zend_Cache_Exception
      * @return string Cache id
      */
-    public function makeId($callback, array $args)
+    public function makeId($callback, array $args = array())
     {
         if (!is_callable($callback, true, $name)) {
             Zend_Cache::throwException('Invalid callback');