mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 10:56:38 +00:00
fixes performance regression
The regression was introduced by 1e09c7b660.
This commit is contained in:
@@ -298,13 +298,11 @@ class Twig_Environment
|
||||
}
|
||||
|
||||
if (!class_exists($cls, false)) {
|
||||
$code = $this->compileSource($this->loader->getSource($name), $name);
|
||||
|
||||
if (false === $cache = $this->getCacheFilename($name)) {
|
||||
eval('?>'.$code);
|
||||
eval('?>'.$this->compileSource($this->loader->getSource($name), $name));
|
||||
} else {
|
||||
if (!file_exists($cache) || ($this->isAutoReload() && !$this->loader->isFresh($name, filemtime($cache)))) {
|
||||
$this->writeCacheFile($cache, $code);
|
||||
$this->writeCacheFile($cache, $this->compileSource($this->loader->getSource($name), $name));
|
||||
}
|
||||
|
||||
require_once $cache;
|
||||
|
||||
Reference in New Issue
Block a user