8000 added some missing docs for the web server bundle · symfony/symfony@987a681 · GitHub
[go: up one dir, main page]

Skip to content

Commit 987a681

Browse files
committed
added some missing docs for the web server bundle
1 parent 85e2d2f commit 987a681

File tree

6 files changed

+46
-5
lines changed

6 files changed

+46
-5
lines changed

src/Symfony/Bundle/WebServerBundle/Command/ServerLogCommand.php

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,22 @@ protected function configure()
4747
}
4848

4949
$this
50-
->setDescription('Start a log server that displays logs in real time')
5150
->addOption('host', null, InputOption::VALUE_REQUIRED, 'The server host', '0:9911')
5251
->addOption('format', null, InputOption::VALUE_REQUIRED, 'The line format', ConsoleFormatter::SIMPLE_FORMAT)
5352
->addOption('date-format', null, InputOption::VALUE_REQUIRED, 'The date format', ConsoleFormatter::SIMPLE_DATE)
5453
->addOption('filter', null, InputOption::VALUE_REQUIRED, 'An expression to filter log. Example: "level > 200 or channel in [\'app\', \'doctrine\']"')
54+
->setDescription('Starts a log server that displays logs in real time')
55+
->setHelp(<<<'EOF'
56+
<info>%command.name%</info> starts a log server to display in real time the log
57+
messages generated by your application:
58+
59+
<info>php %command.full_name%</info>
60+
61+
To get the information as a machine readable format, use the
62+
<comment>--filter</> option:
63+
64+
<info>php %command.full_name% --filter=port</info>
65+
EOF
5566
;
5667
}
5768

src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,22 @@ protected function configure()
4747
$this
4848
->setDefinition(array(
4949
new InputArgument('addressport', InputArgument::OPTIONAL, 'The address to listen to (can be address:port, address, or port)'),
50-
new InputOption('docroot', 'd', InputOption::VALUE_REQUIRED, 'Document root'),
50+
new InputOption('docroot', 'd', InputOption::VALUE_REQUIRED, 'Document root, usually where your front controllers are stored'),
5151
new InputOption('router', 'r', InputOption::VALUE_REQUIRED, 'Path to custom router script'),
5252
))
5353
->setName('server:run')
5454
->setDescription('Runs a local web server')
5555
->setHelp(<<<'EOF'
56-
The <info>%command.name%</info> runs a local web server:
56+
<info>%command.name%</info> runs a local web server: By default, the server
57+
listens on <comment>127.0.0.1</> address and the port number is automatically selected
58+
as the first free port starting from <comment>8000</>:
5759
5860
<info>%command.full_name%</info>
5961
62+
This command blocks the console. If you want to run other commands, stop it by
63+
pressing <comment>Control+C</> or use the non-blocking <comment>server:start</>
64+
command instead.
65+
6066
Change the default address and port by passing them as an argument:
6167
6268
<info>%command.full_name% 127.0.0.1:8080</info>

src/Symfony/Bundle/WebServerBundle/Command/ServerStartCommand.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,15 @@ protected function configure()
5353
))
5454
->setDescription('Starts a local web server in the background')
5555
->setHelp(<<<'EOF'
56-
The <info>%command.name%</info> runs a local web server:
56+
<info>%command.name%</info> runs a local web server: By default, the server
57+
listens on <comment>127.0.0.1</> address and the port number is automatically selected
58+
as the first free port starting from <comment>8000</>:
5759
5860
<info>php %command.full_name%</info>
5961
62+
The server is run in the background and you can keep executing other commands.
63+
Execute <comment>server:stop</> to stop it.
64+
6065
Change the default address and port by passing them as an argument:
6166
6267
<info>php %command.full_name% 127.0.0.1:8080</info>

src/Symfony/Bundle/WebServerBundle/Command/ServerStatusCommand.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,20 @@ protected function configure()
3838
new InputOption('filter', null, InputOption::VALUE_REQUIRED, 'The value to display (one of port, host, or address)'),
3939
))
4040
->setDescription('Outputs the status of the local web server for the given address')
41+
->setHelp(<<<'EOF'
42+
<info>%command.name%</info> shows the details of the given local web
43+
server, such as the address and port where it is listening to:
44+
45+
<info>php %command.full_name%</info>
46+
47+
To get the information as a machine readable format, use the
48+
<comment>--filter</> option:
49+
50+
<info>php %command.full_name% --filter=port</info>
51+
52+
Supported values are <comment>port</>, <comment>host</>, and <comment>address</>.
53+
EOF
54+
)
4155
;
4256
}
4357

src/Symfony/Bundle/WebServerBundle/Command/ServerStopCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ protected function configure()
3737
))
3838
->setDescription('Stops the local web server that was started with the server:start command')
3939
->setHelp(<<<'EOF'
40-
The <info>%command.name%</info> stops the local web server:
40+
<info>%command.name%</info> stops the local web server:
4141
4242
<info>php %command.full_name%</info>
4343
EOF

src/Symfony/Bundle/WebServerBundle/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
WebServerBundle
22
===============
33

4+
WebServerBundle provides commands for running applications using the PHP
5+
built-in web server. It simplifies your local development setup because you
6+
don't have to configure a proper web server such as Apache or Nginx to run your
7+
application.
8+
49
Resources
510
---------
611

0 commit comments

Comments
 (0)
0