Check if cached file exists

This commit is contained in:
Tomasz Orzechowski
2015-10-09 16:23:14 +02:00
committed by Fabien Potencier
parent aa1596785b
commit 154bc9d2c8
+5 -1
View File
@@ -87,6 +87,10 @@ class Twig_Cache_Filesystem implements Twig_CacheInterface
*/
public function getTimestamp($key)
{
return (int) @filemtime($key);
if (\file_exists($key)) {
return (int) @filemtime($key);
}
return 0;
}
}