Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/3027' into develop
Browse files Browse the repository at this point in the history
Forward port #3027
  • Loading branch information
weierophinney committed Nov 20, 2012
2 parents 174d505 + 0037bb0 commit fd98312
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions library/Zend/View/Renderer/PhpRenderer.php
Expand Up @@ -93,6 +93,11 @@ class PhpRenderer implements Renderer, TreeRendererInterface
*/
private $__varsCache = array();

/**
* @var array Cache for the plugin call
*/
private $__pluginCache = array();

/**
* Constructor.
*
Expand Down Expand Up @@ -350,11 +355,13 @@ public function plugin($name, array $options = null)
*/
public function __call($method, $argv)
{
$helper = $this->plugin($method);
if (is_callable($helper)) {
return call_user_func_array($helper, $argv);
if (!isset($this->__pluginCache[$method])) {
$this->__pluginCache[$method] = $this->plugin($method);
}
if (is_callable($this->__pluginCache[$method])) {
return call_user_func_array($this->__pluginCache[$method], $argv);
}
return $helper;
return $this->__pluginCache[$method];
}

/**
Expand Down

0 comments on commit fd98312

Please sign in to comment.