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

[Debug] Create a main guide for Debugging#7071

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
wouterj wants to merge7 commits intosymfony:2.7fromwouterj:debug/create_main_guide

Conversation

@wouterj
Copy link
Member

This topic was missing the main guide. This PR fixes that and also adds a couple more debugging tips.

/fixes#6342

debug.rst Outdated
..toctree::
:maxdepth:1
:glob:
How to Optimize your Development Environment for Debugging
Copy link
Member

Choose a reason for hiding this comment

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

"Your"?

debug.rst Outdated
debug/*
When you work on a Symfony project on your local machine, you should use the
``dev`` environment (``app_dev.php`` front controller). This environment
configuration is optimized for two main purposes.
Copy link
Member

Choose a reason for hiding this comment

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

End this paragraph with a colon?

debug.rst Outdated

* Give the developer accurate feedback whenever something goes wrong (provided
by the web debug toolbar, nice exception pages, profiler, ...);
* Be as similar as possible as the production environment to avoid problems
Copy link
Member

Choose a reason for hiding this comment

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

"Be as close as possible to the production [...]"?

debug.rst Outdated
-----------------------------

Interactive debug tools allow you to walk through the code step by step,
making it easier to indentify which step is causing problems. Symfony works
Copy link
Member

Choose a reason for hiding this comment

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

identify

debug.rst Outdated
with any PHP debug environment, among them:

*Xdebug_, the most well-known PHP debugger;
*PsySH_, a PHPREPL_ (Read-eval-print loop) debugger. Use the
Copy link
Member

Choose a reason for hiding this comment

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

Don't we always enclose links with backticks?

debug.rst Outdated

..tip::

If you disable the PHP caches, don't forget to revert after your debugging
Copy link
Member

Choose a reason for hiding this comment

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

[...] revert these changes after [...]

debug.rst Outdated
To ease the debugging of a variable in your application, you can use the
:doc:`VarDumper component</components/var_dumper>` to dump the content of a
variable. The component provides an alternative to the PHP:phpfunction:`var_dump()`
function, in the form of ``dump()``::
Copy link
Member

Choose a reason for hiding this comment

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

[...] provides thedump() function, an alternative to PHP'svar_dump() function:

debug.rst Outdated
The dumper is not limited to scalar values. Arrays and objects can also be
visualized using the VarDumper. One of the most important advantages of using
``dump()`` is a nicer and more specialized dump of objects (e.g. Doctrine
internals are filtered out when dumping a proxy entity).
Copy link
Member

Choose a reason for hiding this comment

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

[...] dumping an entity proxy

debug.rst Outdated

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

Choose a reason for hiding this comment

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

End the paragraph with a colon?

debug.rst Outdated

``debug:container``
Displays information about the contents of the Symfony container for all public
services. To find only those matching a name, append the name as an argument.
Copy link
Member

Choose a reason for hiding this comment

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

I think the comma can be removed.

debug.rst Outdated
services. To find only those matching a name, append the name as an argument.

``debug:config``
Shows all configured bundles, their class and their alias.
Copy link
Member

Choose a reason for hiding this comment

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

[...] their classes and their aliases.

..tip::

When in doubt how to use a console command, open the help section by
appending the ``--help`` option.
Copy link
Member

Choose a reason for hiding this comment

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

(-h)

debug.rst Outdated

``debug:translation <locale>``
Shows a table of the translation key, the domain, the translation and the
fallback translation for all known messages, if translations exist for
Copy link
Member

Choose a reason for hiding this comment

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

Remove the comma?

@xabbuh
Copy link
Member

I just left some minor comments, but overall I absolutely like this PR. Great work as always Wouter. 👍

Status: Reviewed

@xabbuh
Copy link
Member

Oh, and we need to update the/configuration/front_controllers_and_kernel.rst and fix the link (see the failing build job).

``debug:config``
Shows all configured bundles, their class and their alias.

``debug:router``

Choose a reason for hiding this comment

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

Maybe we should reference here therouter:match command too. In my experience it's very useful for newcomers and is very useful to quickly spot routing problems.

@wouterjwouterjforce-pushed thedebug/create_main_guide branch from5187505 to4f21f3aCompareMarch 19, 2017 17:53
@wouterj
Copy link
MemberAuthor

Ready to merge, thanks for the great review and sorry for the loooooong delay!

To ease the debugging of a variable in your application, you can use the
:doc:`VarDumper component</components/var_dumper>` to dump the content of a
variable. The component provides the ``dump()`` function, an alternative to
PHP's:phpfunction:`var_dump()` function::
Copy link
Contributor

Choose a reason for hiding this comment

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

I would add a not on how to install it or a link for it, as IIRC, unless the application is booted and if you forget to add thedump.php file in yourcomposer.json,dump() won't work

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

The section refers to the VarDumper component installation docs. I don't think we have to duplicate the info here.

theofidry reacted with thumbs up emoji
debug.rst Outdated
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');
Copy link
Contributor

Choose a reason for hiding this comment

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

isloadClassCache() still a thing? I though it was no longer useful with PHP7

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Indeed, let's just remove this section.

@wouterjwouterjforce-pushed thedebug/create_main_guide branch from38d364e to758a9f7CompareOctober 7, 2017 16:01
@wouterj
Copy link
MemberAuthor

Ready to merge imo

@javiereguiluz
Copy link
Member

Wouter, I'm afraid I must close this as "won't fix" because we decided to remove the main debugging article (see#8538) and its contents are moved to different articles of the docs. Cheers!

@wouterjwouterj deleted the debug/create_main_guide branchDecember 23, 2020 12:58
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@javiereguiluzjaviereguiluzjaviereguiluz left review comments

@xabbuhxabbuhxabbuh left review comments

+1 more reviewer

@theofidrytheofidrytheofidry left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

6 participants

@wouterj@xabbuh@javiereguiluz@theofidry@carsonbot@hiddewie

[8]ページ先頭

©2009-2025 Movatter.jp