Skip to content
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

Merged
merged 1 commit into from
Oct 20, 2016
Merged

Added useful debug commands in the debug documentation #7023

merged 1 commit into from
Oct 20, 2016

Conversation

hiddewie
Copy link
Contributor

@hiddewie hiddewie commented Oct 1, 2016

Issue #6342.

Added a small list of available and useful debug commands on the debug page.

Information about the contents of the Symfony container can be found using the
command:

.. code-block:: terminal
Copy link

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).

Copy link
Contributor Author

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.

Copy link
Member

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.

Copy link
Contributor Author

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
Copy link
Member

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

Copy link
Contributor Author

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
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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``
    ...

...

Copy link
Contributor Author

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.

@hiddewie hiddewie changed the base branch from 3.0 to 2.7 October 6, 2016 16:24
@wouterj
Copy link
Member

wouterj commented Oct 6, 2016

👍 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
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

"Displays information about [...]"?

@xabbuh
Copy link
Member

xabbuh commented Oct 7, 2016

👍 besides the minor comments which we can address during the merge

@hiddewie
Copy link
Contributor Author

hiddewie commented Oct 8, 2016

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
@javiereguiluz
Copy link
Member

👍 very nice addition! It's strange that we never documented these useful commands.

Thanks @hiddewie.

@wouterj wouterj merged commit c27fc68 into symfony:2.7 Oct 20, 2016
wouterj added a commit that referenced this pull request Oct 20, 2016
…(hiddewie)

This PR was merged into the 2.7 branch.

Discussion
----------

Added useful debug commands in the debug documentation

Issue #6342.

Added a small list of available and useful debug commands on the debug page.

Commits
-------

c27fc68 Update controllers.rst
@wouterj
Copy link
Member

wouterj commented Oct 20, 2016

Thanks @hiddewie! This is a very helpfull section.

Fyi, I've moved the last paragraph to a tip directive in 7cd7ea8

@hiddewie hiddewie deleted the debugger-commands2 branch October 21, 2016 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants