-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Added useful debug commands in the debug documentation #7023
Conversation
Information about the contents of the Symfony container can be found using the | ||
command: | ||
|
||
.. code-block:: terminal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use bash
instead of terminal
(lexer name terminal
is not known).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Fixed. Strange that it worked locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have to use terminal
instead of bash
. This is a custom lexer we use for terminal examples.
However, we no longer maintain the 3.0 branch, which is why it doesn't exists there. If possible, please rebase this branch against 2.7 (the oldest still maintained branch) using these commands:
# assumed origin is symfony/symfony-docs and hiddewie is your fork
$ git fetch origin
$ git checkout debugger-commands2
$ git rebase --onto origin/2.7 origin/3.0
$ git push hiddewie --force debugger-commands2
Then, click the "edit" button of this PR and also change the base branch to 2.7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Information about the contents of the Symfony container can be found using the | ||
command: | ||
|
||
.. code-block:: terminal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lately we're trying to make docs more compact. Maybe we can merge the code-block + tip + code-block in just one code-block with comments? Something like this:
.. code-block:: terminal
# displays all public services
$ php bin/console debug:container
# displays only the public services that contain
# 'logger' as part of their names
$ php bin/console debug:container logger
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've merged the blocks. Good idea.
|
||
.. code-block:: bash | ||
|
||
# Displays all public services |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
very minor, but I think we never capitialize the first word in a comment
.. code-block:: bash | ||
|
||
# Displays all public services | ||
$ php bin/console debug:container |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we rebasing to 2.7, don't forget to change this to app/console
|
||
.. code-block:: bash | ||
|
||
$ php bin/console debug:config |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure it makes much sense to show the terminal examples, as they are just the name. What about using a definition list like:
When developing a large application, it can be hard to keep track of all the
different services, routes and translations. Luckily, Symfony has some commands
that can help you visualize and find the information.
``debug:container``
To find information about the contents of the Symfony container, either for all
public services, parameters or those matching a name.
``debug:config``
To show all configured bundles, their class and their alias.
``debug:router``
...
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I will change that. Much clearer.
👍 Thanks for your quick responses @hiddewie! status: reviewed |
@@ -59,3 +59,29 @@ locations. To avoid problems, you can either tell your IDE to ignore the PHP | |||
cache files, or you can change the extension used by Symfony for these files:: | |||
|
|||
$kernel->loadClassCache('classes', '.php.cache'); | |||
|
|||
Useful debugging commands |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useful Debugging Commands
that can help you visualize and find the information. | ||
|
||
``debug:container`` | ||
Displays about the contents of the Symfony container for all public |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Displays information about [...]"?
👍 besides the minor comments which we can address during the merge |
Minor changes fixed. Thanks for noticing the typo. |
Added useful debug commands in the debug documentation Merged two commands to shorten the file Fixed bash -> terminal code blocks Updated the command examples to be a list instead pieces of text with large terminal graphics Revert accidental commit Revert invalid changes This reverts commit 8cf0c85. Fixed typo's and campitalization of titles
👍 very nice addition! It's strange that we never documented these useful commands. Thanks @hiddewie. |
Issue #6342.
Added a small list of available and useful debug commands on the debug page.