Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Added an article about private console commands#7051

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
16 commits
Select commitHold shift + click to select a range
fb5e820
Compiled PHP for customized route matching
GeertDDOct 20, 2014
2731d72
minor #4343 Compiled PHP for customized route matching (GeertDD)
wouterjOct 26, 2014
3d88312
Reverted fb5e82
wouterjOct 26, 2014
8bca8c2
Merge remote-tracking branch 'upstream/2.6'
javiereguiluzDec 15, 2014
37253f5
Merge remote-tracking branch 'upstream/2.4'
javiereguiluzJan 2, 2015
b4c6abc
Merge remote-tracking branch 'upstream/master'
javiereguiluzJan 22, 2015
2253d5e
Merge remote-tracking branch 'upstream/master'
javiereguiluzFeb 2, 2015
03b67ea
Merge remote-tracking branch 'upstream/master'
javiereguiluzJun 8, 2015
20d3a3f
Merge remote-tracking branch 'upstream/master'
javiereguiluzJul 3, 2015
8fbcd31
Merge remote-tracking branch 'upstream/master'
javiereguiluzJul 16, 2015
c7a8305
Merge remote-tracking branch 'upstream/master'
javiereguiluzJul 21, 2015
f7587f0
Merge remote-tracking branch 'upstream/master'
javiereguiluzNov 2, 2015
378ad68
Merge remote-tracking branch 'upstream/master'
javiereguiluzMar 14, 2016
e340267
Merge remote-tracking branch 'upstream/master'
javiereguiluzApr 5, 2016
151fde9
Merge remote-tracking branch 'upstream/master'
javiereguiluzApr 13, 2016
78c9293
Added an article about private console commands
javiereguiluzOct 10, 2016
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
2 changes: 1 addition & 1 deletionbook/routing.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -989,7 +989,7 @@ variables that are passed into the expression:
Behind the scenes, expressions are compiled down to raw PHP. Our example
would generate the following PHP in the cache directory::

if (rtrim($pathinfo, '/contact')=== '' && (
if ($pathinfo=== '/contact' && (
in_array($context->getMethod(), array(0 => "GET", 1 => "HEAD"))
&& preg_match("/firefox/i", $request->headers->get("User-Agent"))
)) {
Expand Down
34 changes: 34 additions & 0 deletionsconsole/private_commands.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
Creating Private Console Commands
=================================

Console commands are public by default, meaning that they are listed alongside
other commands when executing the console application script without arguments
or when using the ``list`` command.

However, sometimes commands are not intended to be executed by end-users; for
example, commands for the legacy parts of the application, commands exclusively
executed through scheduled tasks, etc.

In those cases, you can define the command as **private** setting the
``setPublic()`` method to ``false`` in the command configuration::

// src/AppBundle/Command/FooCommand.php
namespace AppBundle\Command;

use Symfony\Component\Console\Command\Command;

class FooCommand extends Command
{
protected function configure()
{
$this
->setName('app:foo')
// ...
->setPublic(false)
;
}
}

Private commands behave the same as public commands and they can be executed as
before, but they are no longer displayed in command listings, so end-users are
not aware of their existence.

[8]ページ先頭

©2009-2025 Movatter.jp