-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[2.5][FrameworkBundle] Fix server run in case the router script does not exist #12489
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
I'm currently checking what's happening on HHVM (I'm total noob on this platform) |
954a368
to
b964292
Compare
HHVM does not support such option ( |
b964292
to
1a79859
Compare
@@ -137,11 +147,18 @@ private function createPhpProcessBuilder(InputInterface $input, OutputInterface | |||
if (!file_exists($router)) { | |||
$output->writeln(sprintf('<error>The given router script "%s" does not exist</error>', $router)); | |||
|
|||
return 1; | |||
return; |
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.
why?
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.
In current implementation, if createPhpProcessBuilder
fails, it returns 1
. The line 102 expects a ProcessBuilder
:
$builder = $this->createPhpProcessBuilder($input, $output, $env);
I prefer to return null
in case no builder is created. I suppose the return 1
is a wrong copy/paste when this code was inside the Command::execute
method and where it was valid
Thank you @romainneutron. |
…cript does not exist (romainneutron) This PR was merged into the 2.5 branch. Discussion ---------- [2.5][FrameworkBundle] Fix server run in case the router script does not exist | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT I've also added the use of `Process\PhpExecutableFinder` Commits ------- 1a79859 [FrameworkBundle] Fix server run in case the router script does not exist
$output->writeln('<error>This command is not supported on HHVM.</error>'); | ||
|
||
return 1; | ||
} |
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 is useless, given that the command is disabled entirely on HHVM, same than on PHP 5.3 (see line 33)
It is already checked in the `isEnabled()` method of the parent `ServerCommand` class if the current PHP build is HHVM and the `server:start` command is never enabled then. Thus, it's not needed to check for HHVM on every command execution. This was pointed out by @stof in symfony#12489 for the `server:run` command.
This PR was merged into the 2.3 branch. Discussion ---------- [FrameworkBundle] backport #12489 | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Commits ------- 556eff1 backport #12489
* 2.3: [Debug] fix error message on double exception Fix initialized() with aliased services Rename Symfony2 to Symfony backport #12489 Conflicts: CONTRIBUTING.md src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php
* 2.5: [Debug] fix error message on double exception Fix initialized() with aliased services Rename Symfony2 to Symfony compare version using PHP_VERSION_ID backport #12489 remove an unneeded check
* 2.6: (36 commits) [Debug] fix error message on double exception [Validator] make DateTime objects represented as strings in the violation message. [RFC] [DebugBundle] [HttpKernel] Avoid using container as dependency for DumpListener Upgrade information for the Translation component regarding the new LoggingTranslator class. [WebProfilerBundle] Remove usage of app.request in search bar template Fix initialized() with aliased services fix data type in docblock Rename Symfony2 to Symfony bumped Symfony version to 2.6.0 updated VERSION for 2.6.0-BETA2 updated CHANGELOG for 2.6.0-BETA2 [Debug] fix ENT_SUBSTITUTE usage compare version using PHP_VERSION_ID backport #12489 remove an unneeded check Remove block submit_widget reformat code as suggested by @fabpot Fix typo Make `\Request::get` more performant. properly set request attributes in controller test ...
* 2.7: (36 commits) [Debug] fix error message on double exception [Validator] make DateTime objects represented as strings in the violation message. [RFC] [DebugBundle] [HttpKernel] Avoid using container as dependency for DumpListener Upgrade information for the Translation component regarding the new LoggingTranslator class. [WebProfilerBundle] Remove usage of app.request in search bar template Fix initialized() with aliased services fix data type in docblock Rename Symfony2 to Symfony bumped Symfony version to 2.6.0 updated VERSION for 2.6.0-BETA2 updated CHANGELOG for 2.6.0-BETA2 [Debug] fix ENT_SUBSTITUTE usage compare version using PHP_VERSION_ID backport #12489 remove an unneeded check Remove block submit_widget reformat code as suggested by @fabpot Fix typo Make `\Request::get` more performant. properly set request attributes in controller test ...
This PR was merged into the 2.6 branch. Discussion ---------- [FrameworkBundle] removed unneeded check | Q | A | ------------- | --- | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | It is already checked in the `isEnabled()` method of the parent `ServerCommand` class if the current PHP build is HHVM and the `server:start` command is never enabled then. Thus, it's not needed to check for HHVM on every command execution. This was pointed out by @stof in #12489 for the `server:run` command. Commits ------- ce2adfa removed unneeded check
* 2.3: [Debug] fix error message on double exception Fix initialized() with aliased services Rename Symfony2 to Symfony backport symfony#12489 Conflicts: CONTRIBUTING.md src/Symfony/Bundle/FrameworkBundle/Command/ServerRunCommand.php src/Symfony/Bundle/TwigBundle/Loader/FilesystemLoader.php
* 2.5: [Debug] fix error message on double exception Fix initialized() with aliased services Rename Symfony2 to Symfony compare version using PHP_VERSION_ID backport symfony#12489 remove an unneeded check
* 2.6: (36 commits) [Debug] fix error message on double exception [Validator] make DateTime objects represented as strings in the violation message. [RFC] [DebugBundle] [HttpKernel] Avoid using container as dependency for DumpListener Upgrade information for the Translation component regarding the new LoggingTranslator class. [WebProfilerBundle] Remove usage of app.request in search bar template Fix initialized() with aliased services fix data type in docblock Rename Symfony2 to Symfony bumped Symfony version to 2.6.0 updated VERSION for 2.6.0-BETA2 updated CHANGELOG for 2.6.0-BETA2 [Debug] fix ENT_SUBSTITUTE usage compare version using PHP_VERSION_ID backport symfony#12489 remove an unneeded check Remove block submit_widget reformat code as suggested by @fabpot Fix typo Make `\Request::get` more performant. properly set request attributes in controller test ...
* 2.7: (36 commits) [Debug] fix error message on double exception [Validator] make DateTime objects represented as strings in the violation message. [RFC] [DebugBundle] [HttpKernel] Avoid using container as dependency for DumpListener Upgrade information for the Translation component regarding the new LoggingTranslator class. [WebProfilerBundle] Remove usage of app.request in search bar template Fix initialized() with aliased services fix data type in docblock Rename Symfony2 to Symfony bumped Symfony version to 2.6.0 updated VERSION for 2.6.0-BETA2 updated CHANGELOG for 2.6.0-BETA2 [Debug] fix ENT_SUBSTITUTE usage compare version using PHP_VERSION_ID backport symfony#12489 remove an unneeded check Remove block submit_widget reformat code as suggested by @fabpot Fix typo Make `\Request::get` more performant. properly set request attributes in controller test ...
I've also added the use of
Process\PhpExecutableFinder