Skip to content

Move debug commands to debug namespace #4210

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
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
7 changes: 5 additions & 2 deletions book/controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -613,12 +613,15 @@ via the ``get()`` method. Here are several common services you might need::
$mailer = $this->get('mailer');

There are countless other services available and you are encouraged to define
your own. To list all available services, use the ``container:debug`` console
your own. To list all available services, use the ``debug:container`` console
command:

.. code-block:: bash

$ php app/console container:debug
$ php app/console debug:container

.. versionadded:: 2.6
Prior to Symfony 2.6, this command was called ``container:debug``.

For more information, see the :doc:`/book/service_container` chapter.

Expand Down
9 changes: 6 additions & 3 deletions book/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1192,12 +1192,15 @@ Visualizing & Debugging Routes

While adding and customizing routes, it's helpful to be able to visualize
and get detailed information about your routes. A great way to see every route
in your application is via the ``router:debug`` console command. Execute
in your application is via the ``debug:router`` console command. Execute
the command by running the following from the root of your project.

.. code-block:: bash

$ php app/console router:debug
$ php app/console debug:router

.. versionadded:: 2.6
Prior to Symfony 2.6, this command was called ``router:debug``.

This command will print a helpful list of *all* the configured routes in
your application:
Expand All @@ -1216,7 +1219,7 @@ the route name after the command:

.. code-block:: bash

$ php app/console router:debug article_show
$ php app/console debug:router article_show

Likewise, if you want to test whether a URL matches a given route, you can
use the ``router:match`` console command:
Expand Down
11 changes: 7 additions & 4 deletions book/service_container.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1169,18 +1169,21 @@ console. To show all services and the class for each service, run:

.. code-block:: bash

$ php app/console container:debug
$ php app/console debug:container

.. versionadded:: 2.6
Prior to Symfony 2.6, this command was called ``container:debug``.

By default only public services are shown, but you can also view private services:

.. code-block:: bash

$ php app/console container:debug --show-private
$ php app/console debug:container --show-private

.. note::

If a private service is only used as an argument to just *one* other service,
it won't be displayed by the ``container:debug`` command, even when using
it won't be displayed by the ``debug:container`` command, even when using
the ``--show-private`` option. See :ref:`Inline Private Services <inlined-private-services>`
for more details.

Expand All @@ -1189,7 +1192,7 @@ its id:

.. code-block:: bash

$ php app/console container:debug my_mailer
$ php app/console debug:container my_mailer

Learn more
----------
Expand Down
5 changes: 4 additions & 1 deletion book/testing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,10 @@ injection container::

Be warned that this does not work if you insulate the client or if you use an
HTTP layer. For a list of services available in your application, use the
``container:debug`` console task.
``debug:container`` console task.

.. versionadded:: 2.6
Prior to Symfony 2.6, this command was called ``container:debug``.

.. tip::

Expand Down
15 changes: 9 additions & 6 deletions book/translation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -662,10 +662,13 @@ Debugging Translations
----------------------

.. versionadded:: 2.5
The ``translation:debug`` command was introduced in Symfony 2.5.
The ``debug:translation`` command was introduced in Symfony 2.5.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This part could be misleading. Any improvements are welcome

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed by the new formulation proposed by @weaverryan


.. versionadded:: 2.6
Prior to Symfony 2.6, this command was called ``translation:debug``.

When maintaining a bundle, you may use or remove the usage of a translation
message without updating all message catalogues. The ``translation:debug``
message without updating all message catalogues. The ``debug:translation``
command helps you to find these missing or unused translation messages for a
given locale. It shows you a table with the result when translating the
message in the given locale and the result when the fallback would be used.
Expand Down Expand Up @@ -774,7 +777,7 @@ To inspect all messages in the ``fr`` locale for the AcmeDemoBundle, run:

.. code-block:: bash

$ php app/console translation:debug fr AcmeDemoBundle
$ php app/console debug:translation fr AcmeDemoBundle

You will get this output:

Expand Down Expand Up @@ -815,15 +818,15 @@ By default all domains are inspected, but it is possible to specify a single dom

.. code-block:: bash

$ php app/console translation:debug en AcmeDemoBundle --domain=messages
$ php app/console debug:translation en AcmeDemoBundle --domain=messages

When bundles have a lot of messages, it is useful to display only the unused
or only the missing messages, by using the ``--only-unused`` or ``--only-missing`` switches:

.. code-block:: bash

$ php app/console translation:debug en AcmeDemoBundle --only-unused
$ php app/console translation:debug en AcmeDemoBundle --only-missing
$ php app/console debug:translation en AcmeDemoBundle --only-unused
$ php app/console debug:translation en AcmeDemoBundle --only-missing

Summary
-------
Expand Down