Skip to content

[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

Merged
merged 1 commit into from
Nov 16, 2014

Conversation

romainneutron
Copy link
Contributor

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

@romainneutron romainneutron changed the title [FrameworkBundle] Fix server run in case the router script does not exist [2.5][FrameworkBundle] Fix server run in case the router script does not exist Nov 15, 2014
@romainneutron
Copy link
Contributor Author

I'm currently checking what's happening on HHVM (I'm total noob on this platform)

@romainneutron
Copy link
Contributor Author

HHVM does not support such option (-S), so I made the command failing in this case

@@ -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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why?

Copy link
Contributor Author

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

@fabpot
Copy link
Member

fabpot commented Nov 16, 2014

Thank you @romainneutron.

@fabpot fabpot merged commit 1a79859 into symfony:2.5 Nov 16, 2014
fabpot added a commit that referenced this pull request Nov 16, 2014
…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;
}
Copy link
Member

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)

xabbuh added a commit to xabbuh/symfony that referenced this pull request Nov 23, 2014
xabbuh added a commit to xabbuh/symfony that referenced this pull request Nov 23, 2014
xabbuh added a commit to xabbuh/symfony that referenced this pull request Nov 23, 2014
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.
fabpot added a commit that referenced this pull request Nov 28, 2014
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
fabpot added a commit that referenced this pull request Nov 28, 2014
* 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
fabpot added a commit that referenced this pull request Nov 28, 2014
* 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
fabpot added a commit that referenced this pull request Nov 28, 2014
* 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
  ...
fabpot added a commit that referenced this pull request Nov 28, 2014
* 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
  ...
fabpot added a commit that referenced this pull request Nov 29, 2014
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
ostrolucky pushed a commit to ostrolucky/symfony that referenced this pull request Mar 25, 2018
* 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
ostrolucky pushed a commit to ostrolucky/symfony that referenced this pull request Mar 25, 2018
* 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
ostrolucky pushed a commit to ostrolucky/symfony that referenced this pull request Mar 25, 2018
* 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
  ...
ostrolucky pushed a commit to ostrolucky/symfony that referenced this pull request Mar 25, 2018
* 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
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants