replace file_exists() by is_file() as this is semantically more correct (we don't...
authorFabien Potencier <fabien.potencier@gmail.com>
Sat, 27 Aug 2011 07:56:45 +0000 (09:56 +0200)
committerFabien Potencier <fabien.potencier@gmail.com>
Sat, 27 Aug 2011 07:56:45 +0000 (09:56 +0200)
lib/Twig/Autoloader.php
lib/Twig/Environment.php
lib/Twig/Error.php

index ba43e14..a93b8ca 100644 (file)
@@ -39,7 +39,7 @@ class Twig_Autoloader
             return;
         }
 
-        if (file_exists($file = dirname(__FILE__).'/../'.str_replace(array('_', "\0"), array('/', ''), $class).'.php')) {
+        if (is_file($file = dirname(__FILE__).'/../'.str_replace(array('_', "\0"), array('/', ''), $class).'.php')) {
             require $file;
         }
     }
index d706f6c..5c302f3 100644 (file)
@@ -301,7 +301,7 @@ class Twig_Environment
             if (false === $cache = $this->getCacheFilename($name)) {
                 eval('?>'.$this->compileSource($this->loader->getSource($name), $name));
             } else {
-                if (!file_exists($cache) || ($this->isAutoReload() && !$this->loader->isFresh($name, filemtime($cache)))) {
+                if (!is_file($cache) || ($this->isAutoReload() && !$this->loader->isFresh($name, filemtime($cache)))) {
                     $this->writeCacheFile($cache, $this->compileSource($this->loader->getSource($name), $name));
                 }
 
index d05d83c..d6946f0 100644 (file)
@@ -161,7 +161,7 @@ class Twig_Error extends Exception
                 continue;
             }
 
-            if (!file_exists($r->getFilename())) {
+            if (!is_file($r->getFilename())) {
                 // probably an eval()'d code
                 return array($currentLine, $currentFile);
             }