-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Global dump #4883
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
Global dump #4883
Conversation
Q | A |
---|---|
Doc fix? | no |
New docs? | yes |
Applies to | all |
Fixed tickets | - |
``composer global require symfony/var-dumper`` then add | ||
``auto_prepend_file = ${HOME}/.composer/vendor/autoload.php`` | ||
to your ``php.ini`` file. Don't forget to run ``composer global update`` | ||
from time to time to keep up with the latest fixes. |
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 think it's more clear to put this in a step list:
.. tip::
In order to have to ``dump()`` function always available, you can install
it globally in your dev environment:
#. Run ``composer global require symfony/var-dumper``;
#. Add ``auto_prepend_file = ${HOME}/.composer/vendor/autoload.php``
to your ``php.ini`` file;
#. (Don't forget to run ``composer global update`` from time to time to always
have the latest bug fixes.)
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.
Fixed, thanks
32f4e4a
to
c34ed68
Compare
|
||
#. Run ``composer global require symfony/var-dumper``; | ||
#. Add ``auto_prepend_file = ${HOME}/.composer/vendor/autoload.php`` | ||
to your ``php.ini`` file; |
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.
Does PHP interpret environment variables in the php.ini
file? What happens when the file doesn't exist?
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.
- Yes it does: http://php.net/manual/en/configuration.file.php
- A fatal error
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.
Should we add a warning then? Otherwise, people could get these errors when they execute PHP scripts with different users.
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 think the error message is good enough to not clutter the doc, what do you think?
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. Will each and every beginner really understand that a global Composer installation is only global in regard of their user account? We should keep in mind that the web server might not be the same account as the one the developer is using.
Looks like a very nice tip to add to the documentation! :) |
👍 |
The phrase ... in your dev environment
may sound confusing. This has nothing to do with the dev
environment of Symfony applications. I would replace it by:
In order to have the ``dump()`` function available for any PHP script or application and not only for
your Symfony applications, you can install it globally in your machine:
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 do agree with you, but I also don't like the verbose thing you proposed. The docs are always a fight between making something easy to understand and keeping something as short as possible (especially when it's about simple tips like this).
What do you think about replacing "environment" with "machine" or "box"?
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.
It's true that my proposal is more verbose, but I think it explains the purpose of the tip better.
In the original text, what does "to have the function always available" mean? That's why I prefer to say explicitly that this is referring to using it outside Symfony applications.
And the same for dev environment
or dev box
. Prefer to say your machine
, your computer
, your local machine
, etc.