From 585d4451c87fb610cbc14c9fe83c462eedad503a Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 30 Dec 2016 08:41:24 +0100 Subject: [PATCH] [WebServerBundle] tweaked command docs --- .../WebServerBundle/Command/ServerRunCommand.php | 10 +++------- .../WebServerBundle/Command/ServerStartCommand.php | 10 +++------- src/Symfony/Bundle/WebServerBundle/WebServer.php | 7 +++---- 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php b/src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php index c7308c57e9..d751a0c48d 100644 --- a/src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php +++ b/src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php @@ -44,22 +44,18 @@ The %command.name% runs a local web server: %command.full_name% -To change default bind address and port use the address argument: +Change the default address and port by passing them as an argument: %command.full_name% 127.0.0.1:8080 -To change default docroot directory use the --docroot option: +Use the --docroot option to change the default docroot directory: %command.full_name% --docroot=htdocs/ -If you have custom docroot directory layout, you can specify your own -router script using --router option: +Specify your own router script via the --router option: %command.full_name% --router=app/config/router.php -Specifing a router script is required when the used environment is not "dev", -"prod", or "test". - See also: http://www.php.net/manual/en/features.commandline.webserver.php EOF ) diff --git a/src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php b/src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php index 42b897909f..e6cf18430f 100644 --- a/src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php +++ b/src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php @@ -43,22 +43,18 @@ The %command.name% runs a local web server: php %command.full_name% -To change the default bind address and the default port use the address argument: +Change the default address and port by passing them as an argument: php %command.full_name% 127.0.0.1:8080 -To change the default document root directory use the --docroot option: +Use the --docroot option to change the default docroot directory: php %command.full_name% --docroot=htdocs/ -If you have a custom document root directory layout, you can specify your own -router script using the --router option: +Specify your own router script via the --router option: php %command.full_name% --router=app/config/router.php -Specifying a router script is required when the used environment is not "dev" or -"prod". - See also: http://www.php.net/manual/en/features.commandline.webserver.php EOF ) diff --git a/src/Symfony/Bundle/WebServerBundle/WebServer.php b/src/Symfony/Bundle/WebServerBundle/WebServer.php index 7713bd8049..52b787971b 100644 --- a/src/Symfony/Bundle/WebServerBundle/WebServer.php +++ b/src/Symfony/Bundle/WebServerBundle/WebServer.php @@ -120,14 +120,13 @@ class WebServer $process->disableOutput(); $process->start(); - $lockFile = $this->getLockFile(); - touch($lockFile); - if (!$process->isRunning()) { - unlink($lockFile); throw new \RuntimeException('Unable to start the server process.'); } + $lockFile = $this->getLockFile(); + touch($lockFile); + // stop the web server when the lock file is removed while ($process->isRunning()) { if (!file_exists($lockFile)) {