Skip to content

[13.x] Allow reading files from the running phar - #62174

Merged
taylorotwell merged 1 commit into
laravel:13.xfrom
xurshudyan:allow-running-phar
Oct 26, 2026
Merged

taylorotwell merged 1 commit into
laravel:13.xfrom
xurshudyan:allow-running-phar

Conversation

@xurshudyan

Copy link
Copy Markdown
Contributor

#62164 blocks every phar:// path in exists() and isFile(), but that also includes files inside the phar the app is running from. Apps built into a single phar (like Laravel Zero's app:build) load their translations, views and stubs through those paths, so they break:

$files->exists('phar:///path/app.phar/stub.txt'); // false, while file_exists() is true
__('messages.hello');                             // "messages.hello"
view('welcome');                                   // View [welcome] not found.

Paths inside Phar::running() are now allowed, while any other phar archive is still blocked.

@AsahiSoftWareEngineer

Copy link
Copy Markdown
Contributor

@xurshudyan
Sorry, I overlooked this use case when making the original change. Thanks for catching this and putting together a fix.

@taylorotwell
taylorotwell merged commit 02e2f70 into laravel:13.x Oct 26, 2026
64 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants