Skip to content

Commit 582f3d8

Browse files
authored
fix: add file_exists check to ensureCompiled in-memory cache guard (#97)
The in-memory cache in ensureCompiled() assumed that once a view was compiled, the compiled file would always exist on disk. When compiled views are cleared (e.g. via artisan view:clear) while the process is still running, the stale cache entry causes require_once to fail with a file-not-found error. Adding a file_exists($compiledPath) check alongside the isset() guard ensures the compiled file is re-created when it has been removed. Fixes #96
1 parent 43a410c commit 582f3d8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Runtime/BlazeRuntime.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function __construct()
4545
*/
4646
public function ensureCompiled(string $path, string $compiledPath): void
4747
{
48-
if (isset($this->compiled[$path])) {
48+
if (isset($this->compiled[$path]) && file_exists($compiledPath)) {
4949
return;
5050
}
5151

0 commit comments

Comments
 (0)