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
[FrameworkBundle] Workaround php -S ignoring auto_prepend_file #14272
Conversation
865eb2a
to
45c48bd
Compare
45c48bd
to
dcde445
Compare
What about |
auto_append_file is bugged also, but we can't do anything about it, there is no sane way to detect that the filewill not be included. |
Do we really need to support it here? Would it be better to just wait for the PHP bug fix? I mean, how many Symfony users are using this "weird" PHP feature anyway? |
I rely on this to have a consistent debugging env (think |
ping @symfony/deciders @symfony/mergers |
👍 |
…file (nicolas-grekas) This PR was merged into the 2.3 branch. Discussion ---------- [FrameworkBundle] Workaround php -S ignoring auto_prepend_file | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - `php -S front_controller.php` (thus `php app/console server:run`) ignores auto_prepend_file for no reason. Commits ------- dcde445 [FrameworkBundle] Workaround php -S ignoring auto_prepend_file
// Workaround https://bugs.php.net/64566 | ||
if (ini_get('auto_prepend_file') && !in_array(realpath(ini_get('auto_prepend_file')), get_included_files(), true)) { | ||
require ini_get('auto_prepend_file'); | ||
} |
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.
this should be done only after the check for asset files IMO
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.
To be a real and exact workaround, we must replicate the behavior of the native feature, thus doing this first
php -S front_controller.php
(thusphp app/console server:run
) ignores auto_prepend_file for no reason.