Skip to content

Commit

Permalink
Load TemplatePathStackResolver only when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
ojhaujjwal authored and Ocramius committed Dec 8, 2014
1 parent 1107d23 commit 556597d
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions library/Zend/View/Resolver/PrefixPathStackResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,20 +181,18 @@ public function getTemplatePathStackResolver($prefix)
public function resolve($name, Renderer $renderer = null)
{
foreach ($this->prefixes as $prefix => $paths) {
if (strpos($name, $prefix) !== 0) {
continue;
}

$templatePathStackResolver = $this->getTemplatePathStackResolver($prefix);
$templatePathStackResolver->setPaths($paths);
$templatePathStackResolver->setDefaultSuffix($this->getDefaultSuffix());
$templatePathStackResolver->setLfiProtection($this->isLfiProtectionOn());
}

foreach ($this->prefixes as $prefix => $paths) {
if (strpos($name, $prefix) !== 0) {
continue;
}

$template = substr($name, strlen($prefix));

return $this->getTemplatePathStackResolver($prefix)->resolve($template, $renderer);
return $templatePathStackResolver->resolve($template, $renderer);
}
}
}

0 comments on commit 556597d

Please sign in to comment.