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#7052

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
Changes fromall 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
32 changes: 32 additions & 0 deletionsconsole/hide_commands.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
How to Hide Console Commands
============================

By default, all console commands are listed 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 **hidden** by setting the
``setHidden()`` method to ``true`` in the command configuration::

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

use Symfony\Component\Console\Command\Command;

class LegacyCommand extends Command
{
protected function configure()
{
$this
->setName('app:legacy')
->setHidden(true)
// ...
;
}
}

Hidden commands behave the same as normal commands but they are no longer displayed
in command listings, so end-users are not aware of their existence.

[8]ページ先頭

©2009-2025 Movatter.jp