Skip to content
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

Merged
merged 1 commit into from Apr 18, 2015

Conversation

nicolas-grekas
Copy link
Member

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.

@nicolas-grekas
Copy link
Member Author

See https://bugs.php.net/64566

@jakzal
Copy link
Contributor

jakzal commented Apr 9, 2015

What about auto_append_file?

@nicolas-grekas
Copy link
Member Author

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.

@fabpot
Copy link
Member

fabpot commented Apr 10, 2015

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?

@nicolas-grekas
Copy link
Member Author

I rely on this to have a consistent debugging env (think dump()) all the time.

@nicolas-grekas
Copy link
Member Author

ping @symfony/deciders @symfony/mergers

@fabpot
Copy link
Member

fabpot commented Apr 18, 2015

👍

@nicolas-grekas nicolas-grekas merged commit dcde445 into symfony:2.3 Apr 18, 2015
nicolas-grekas added a commit that referenced this pull request Apr 18, 2015
…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
@nicolas-grekas nicolas-grekas deleted the fwk-fix23 branch April 18, 2015 10:24
// 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');
}
Copy link
Member

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

Copy link
Member Author

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

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.

None yet

4 participants