Skip to content

Commit

Permalink
bug #14272 [FrameworkBundle] Workaround php -S ignoring auto_prepend_…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
nicolas-grekas committed Apr 18, 2015
2 parents a7a1ff2 + dcde445 commit 1014719
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
* @author: Albert Jessurum <ajessu@gmail.com>
*/

// 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');
}

if (is_file($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR.$_SERVER['SCRIPT_NAME'])) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
* @author: Albert Jessurum <ajessu@gmail.com>
*/

// 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');
}

if (is_file($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR.$_SERVER['SCRIPT_NAME'])) {
return false;
}
Expand Down

0 comments on commit 1014719

Please sign in to comment.