-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable #38063
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
Conversation
Recipe update at symfony/recipes#817 |
7047a87
to
51d8d33
Compare
src/Symfony/Bundle/FrameworkBundle/Command/CacheClearCommand.php
Outdated
Show resolved
Hide resolved
51d8d33
to
faf01b6
Compare
Doc update: symfony/symfony-docs#14176 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you Nicolas 🥰😍
faf01b6
to
54c965c
Compare
Updated to |
Thank you @nicolas-grekas. |
This PR was merged into the 4.4 branch. Discussion ---------- Fix path to preload file According to symfony/symfony#38063 Commits ------- b830395 Fix path to preload file
@nicolas-grekas sorry, I'm not sure, but will this work on environments with read-only src/? |
@nicolas-grekas any way to disable this behaviour? We currently have some issues with the preloading in sulu and this file should not be generated in our case. Also I personally think cache:clear should nothing write in the If the file stays at |
var/ and config/ don't exist from the pov of the code. The code knows only about a cache-dir, a project-dir and the directory where the Kernel is found (by reflection). But why is generating this file an issue? You didn't explain it. If preloading doesn't work with sulu, just don't use it?
That'd mean hardcoding the env in the path (since the path contains "prod"). Doable, but this would need a reason (the current way has the benefit of being unconditional, thus quite easy to configure by default by hosters). |
Please note that if you think this should be discussed seriously, a closed PR is not the place as it will be forgotten. |
@nicolas-grekas oh sorry you are correct an own issue would be better created one here: #38334. Mostly the problem is on our side that its misleading devs using sulu that preloading is now possible over this file generated by symfony but its currently not in sulu so we would like to avoid generating of it until preloading is supported. |
…in src/ to make opcache.preload predictable" (nicolas-grekas) This PR was merged into the 4.4 branch. Discussion ---------- Revert "bug #38063 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable" | Q | A | ------------- | --- | Branch? | 4.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #38334 | License | MIT | Doc PR | - As discussed in the linked issue, let's replace this with a recipe: symfony/recipes#825 TL;DR, these PRs replace `src/.preload.php` (generated) by `config/preload.php` (committed). Commits ------- 662fcff Revert "bug #38063 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable (nicolas-grekas)"
* 4.4: Revert "bug #38063 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable (nicolas-grekas)" [PhpUnitBridge] Fix class_alias() for PHPUnit\Framework\Error\Error
* 5.1: [FrameworkBundle] Add Mailjet definition Revert "bug #38063 [FrameworkBundle] generate preload.php in src/ to make opcache.preload predictable (nicolas-grekas)" [PhpUnitBridge] Fix class_alias() for PHPUnit\Framework\Error\Error
As seen in symfonycorp/cloud-templates#15, having the path of the preload file vary by env+debug makes configuring PHP.ini settings impossible.
This PR dump a new
preload.php
file insrc/
whencache:clear
is called.This makes the path predictable.
This is submitted as a bugfix because the current behavior is barely usable without this change.