Skip to content

Commit

Permalink
minor #22607 Add some missing docs for the web server bundle (fabpot)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.3-dev branch.

Discussion
----------

Add some missing docs for the web server bundle

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | n/a
| License       | MIT
| Doc PR        | n/a

This is an alternative to #22471

Commits
-------

987a681 added some missing docs for the web server bundle
  • Loading branch information
fabpot committed May 3, 2017
2 parents 09f22f4 + 987a681 commit deda9ea
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 5 deletions.
13 changes: 12 additions & 1 deletion src/Symfony/Bundle/WebServerBundle/Command/ServerLogCommand.php
Expand Up @@ -47,11 +47,22 @@ protected function configure()
}

$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
;
}

Expand Down
10 changes: 8 additions & 2 deletions src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php
Expand Up @@ -47,16 +47,22 @@ protected function configure()
$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>
Expand Down
Expand Up @@ -53,10 +53,15 @@ protected function configure()
))
->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>
Expand Down
14 changes: 14 additions & 0 deletions src/Symfony/Bundle/WebServerBundle/Command/ServerStatusCommand.php
Expand Up @@ -38,6 +38,20 @@ protected function configure()
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
)
;
}

Expand Down
Expand Up @@ -37,7 +37,7 @@ protected function configure()
))
->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
Expand Down
5 changes: 5 additions & 0 deletions src/Symfony/Bundle/WebServerBundle/README.md
@@ -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
---------

Expand Down

0 comments on commit deda9ea

Please sign in to comment.