-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[8.x] Fix require fails if is_file cached by opcache #41614
Conversation
It's best that you explain what you're doing here or your PR will be closed (see the PR template when submitting PR's). |
Also if this also exists in 8.x it should be sent in to that branch: https://laravel.com/docs/9.x/contributions#which-branch |
It does exist in 8.x so, I'll rebase the PR |
The main issue here probably is that you're enabling opcache on the CLI which I don't see a use case for. |
I know but it's not always in our power to change this with some hosts because both the cli and php-fpm must have the same config file which would in turn impact performance on the front |
Why did you change the branch again? Can you also update the PR title when you do? |
Sure, sorry It's on 8.x, I messed up the first time |
After some testing, no need for try catch, file_exists fixes the issue entirely |
Fixes #41613
In the case where
opcache.enable_file_override
is enabled, theis_file
call might returntrue
because it's cached until the end of the script so the require will fail if it was unlinked during the execution which is the case when running the commandartisan config:cache
This just changes
is_file
tofile_exists
which is the method to use before a require and is not affected by this issue