From 9a9679be771d59202b80f68211a262a472026b62 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sat, 14 Aug 2010 13:50:37 +0200 Subject: [PATCH] simplified code --- lib/Twig/Environment.php | 12 +++--------- 1 files changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/Twig/Environment.php b/lib/Twig/Environment.php index dd8fc68..28e8fe0 100644 --- a/lib/Twig/Environment.php +++ b/lib/Twig/Environment.php @@ -199,16 +199,10 @@ class Twig_Environment eval('?>'.$this->compileSource($this->loader->getSource($name), $name)); } else { if (!file_exists($cache) || ($this->isAutoReload() && !$this->loader->isFresh($name, filemtime($cache)))) { - $content = $this->compileSource($this->loader->getSource($name), $name); - - if (false === $this->writeCacheFile($cache, $content)) { - eval('?>'.$content); - } else { - require_once $cache; - } - } else { - require_once $cache; + $this->writeCacheFile($cache, $this->compileSource($this->loader->getSource($name), $name)); } + + require_once $cache; } } -- 1.7.2.5