Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add some missing docs for the web server bundle #22607

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
May 3, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/Symfony/Bundle/WebServerBundle/Command/ServerLogCommand.php
Original file line number Diff line number Diff line change
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
;
Copy link
Member

Choose a reason for hiding this comment

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

missing ) fixed in #22626

}

Expand Down
10 changes: 8 additions & 2 deletions src/Symfony/Bundle/WebServerBundle/Command/ServerRunCommand.php
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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