added some missing docs for the web server bundle

This commit is contained in:
Fabien Potencier 2017-05-01 18:24:19 -07:00
parent 85e2d2f91d
commit 987a6819d2
6 changed files with 46 additions and 5 deletions

View File

@ -47,11 +47,22 @@ class ServerLogCommand extends Command
}
$this
->setDescription('Start a log server that displays logs in real time')
->addOption('host', null, InputOption::VALUE_REQUIRED, 'The server host', '0:9911')
->addOption('format', null, InputOption::VALUE_REQUIRED, 'The line format', ConsoleFormatter::SIMPLE_FORMAT)
->addOption('date-format', null, InputOption::VALUE_REQUIRED, 'The date format', ConsoleFormatter::SIMPLE_DATE)
->addOption('filter', null, InputOption::VALUE_REQUIRED, 'An expression to filter log. Example: "level > 200 or channel in [\'app\', \'doctrine\']"')
->setDescription('Starts a log server that displays logs in real time')
->setHelp(<<<'EOF'
<info>%command.name%</info> starts a log server to display in real time the log
messages generated by your application:
<info>php %command.full_name%</info>
To get the information as a machine readable format, use the
<comment>--filter</> option:
<info>php %command.full_name% --filter=port</info>
EOF
;
}

View File

@ -47,16 +47,22 @@ class ServerRunCommand extends ServerCommand
$this
->setDefinition(array(
new InputArgument('addressport', InputArgument::OPTIONAL, 'The address to listen to (can be address:port, address, or port)'),
new InputOption('docroot', 'd', InputOption::VALUE_REQUIRED, 'Document root'),
new InputOption('docroot', 'd', InputOption::VALUE_REQUIRED, 'Document root, usually where your front controllers are stored'),
new InputOption('router', 'r', InputOption::VALUE_REQUIRED, 'Path to custom router script'),
))
->setName('server:run')
->setDescription('Runs a local web server')
->setHelp(<<<'EOF'
The <info>%command.name%</info> runs a local web server:
<info>%command.name%</info> runs a local web server: By default, the server
listens on <comment>127.0.0.1</> address and the port number is automatically selected
as the first free port starting from <comment>8000</>:
<info>%command.full_name%</info>
This command blocks the console. If you want to run other commands, stop it by
pressing <comment>Control+C</> or use the non-blocking <comment>server:start</>
command instead.
Change the default address and port by passing them as an argument:
<info>%command.full_name% 127.0.0.1:8080</info>

View File

@ -53,10 +53,15 @@ class ServerStartCommand extends ServerCommand
))
->setDescription('Starts a local web server in the background')
->setHelp(<<<'EOF'
The <info>%command.name%</info> runs a local web server:
<info>%command.name%</info> runs a local web server: By default, the server
listens on <comment>127.0.0.1</> address and the port number is automatically selected
as the first free port starting from <comment>8000</>:
<info>php %command.full_name%</info>
The server is run in the background and you can keep executing other commands.
Execute <comment>server:stop</> to stop it.
Change the default address and port by passing them as an argument:
<info>php %command.full_name% 127.0.0.1:8080</info>

View File

@ -38,6 +38,20 @@ class ServerStatusCommand extends ServerCommand
new InputOption('filter', null, InputOption::VALUE_REQUIRED, 'The value to display (one of port, host, or address)'),
))
->setDescription('Outputs the status of the local web server for the given address')
->setHelp(<<<'EOF'
<info>%command.name%</info> shows the details of the given local web
server, such as the address and port where it is listening to:
<info>php %command.full_name%</info>
To get the information as a machine readable format, use the
<comment>--filter</> option:
<info>php %command.full_name% --filter=port</info>
Supported values are <comment>port</>, <comment>host</>, and <comment>address</>.
EOF
)
;
}

View File

@ -37,7 +37,7 @@ class ServerStopCommand extends ServerCommand
))
->setDescription('Stops the local web server that was started with the server:start command')
->setHelp(<<<'EOF'
The <info>%command.name%</info> stops the local web server:
<info>%command.name%</info> stops the local web server:
<info>php %command.full_name%</info>
EOF

View File

@ -1,6 +1,11 @@
WebServerBundle
===============
WebServerBundle provides commands for running applications using the PHP
built-in web server. It simplifies your local development setup because you
don't have to configure a proper web server such as Apache or Nginx to run your
application.
Resources
---------