Skip to content

Commit

Permalink
don't try to load cache file if it doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
akhumphrey committed May 24, 2021
1 parent 3423d41 commit c722dcc
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions lib/autoload/sfAutoload.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,9 @@ public function reloadClasses($force = false)
if (is_file($path))
{
self::$freshCache = false;
if ($force)
if ($force && file_exists($path) && is_writeable($path))
{
if (file_exists($path) && is_writeable($path))
{
unlink($path);
}
unlink($path);
}
}

Expand All @@ -146,7 +143,7 @@ public function reloadClasses($force = false)
// workaround for https://github.com/facebook/hhvm/issues/1447
$this->classes = eval(str_replace('<?php', '', file_get_contents($file)));
}
else
elseif (file_exists($path) && is_readable($path))
{
$this->classes = include $file;
}
Expand Down

0 comments on commit c722dcc

Please sign in to comment.