Zend Framework

Function Cache makeid 'Incorrect function name'

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.10.5
  • Fix Version/s: 1.10.7
  • Component/s: Zend_Cache
  • Labels:
    None

Description

When using call like in the call_user_func_array docs example http://php.net/manual/en/function.call-user-func-array.php, if we try to call the method of an object, it throws Zend_Cache::throwException('Incorrect function name');

Example:
$api = new MyApi();
$xml = $cache->call(array($api, 'searchProducts'), $args);

So I would modify the "incorrect..." by this:
if (!is_string($name)) { //Zend_Cache::throwException('Incorrect function name'); $name = print_r($name, true); }

Issue Links

Activity

Hide
Mauro Asprea added a comment -

To clarify, this is how the _makeid of the Zend_Cache_Frontend_Function should look like:

private function _makeId($name, $parameters)
{
if (!is_string($name)) { //Zend_Cache::throwException('Incorrect function name'); $name = print_r($name, true); }
if (!is_array($parameters)) { Zend_Cache::throwException('parameters argument must be an array'); }
return md5($name . serialize($parameters));
}

Show
Mauro Asprea added a comment - To clarify, this is how the _makeid of the Zend_Cache_Frontend_Function should look like: private function _makeId($name, $parameters) { if (!is_string($name)) { //Zend_Cache::throwException('Incorrect function name'); $name = print_r($name, true); } if (!is_array($parameters)) { Zend_Cache::throwException('parameters argument must be an array'); } return md5($name . serialize($parameters)); }
Hide
Marc Bennewitz (private) added a comment -

I committed some changes to the function frontend to allow all types of callbacks.
(r22503 @ trunk)

Please tell me if it will close your issue.

Show
Marc Bennewitz (private) added a comment - I committed some changes to the function frontend to allow all types of callbacks. (r22503 @ trunk) Please tell me if it will close your issue.
Hide
Marc Bennewitz (private) added a comment -

fixed in r22504 (1.10 branch) & r22503 (trunk)

Show
Marc Bennewitz (private) added a comment - fixed in r22504 (1.10 branch) & r22503 (trunk)

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: