simplified code
authorFabien Potencier <fabien.potencier@gmail.com>
Sat, 14 Aug 2010 11:50:37 +0000 (13:50 +0200)
committerFabien Potencier <fabien.potencier@gmail.com>
Sat, 14 Aug 2010 11:50:37 +0000 (13:50 +0200)
lib/Twig/Environment.php

index dd8fc68..28e8fe0 100644 (file)
@@ -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;
             }
         }