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

[DX] Document the environment variables supported by the console script #4162

Closed
stof opened this issue Aug 22, 2014 · 5 comments
Closed

[DX] Document the environment variables supported by the console script #4162

stof opened this issue Aug 22, 2014 · 5 comments
Labels
actionable Clear and specific issues ready for anyone to take them. DX good first issue Ideal for your first contribution! (some Symfony experience may be required)

Comments

@stof
Copy link
Member

stof commented Aug 22, 2014

The console script provided in the SE allows to choose the environment and the debug mode through environment variables rather than using options. This should be documented as it is very useful when automating things or when running some commands during the composer install (which happens in the default setup)

See symfony/symfony#11704 for one of the discussions olved by saying "these environment variables allow to do it"

@javiereguiluz
Copy link
Member

For reference purposes, these are the specific code lines that show how does this work: https://github.com/symfony/symfony-standard/blob/master/app/console#L18-19

@wouterj
Copy link
Member

wouterj commented Aug 22, 2014

This should be documented in sections where we talk about such commands (e.g. book/installation)

@javiereguiluz
Copy link
Member

I've prepared the following simple explanation of these two variables, but I don't really know where to put it. @xabbuh @wouterj @weaverryan I need your help deciding the best place (and tweaking the proposed doc):

In addition to ``--env`` and ``--debug`` options, Symfony commands behavior can
also be controlled with environment variables. The Symfony console application
checks the existence and value of these environment variables before executing
any command:

* ``SYMFONY_ENV``, sets the environment in which the command is executed, 
  which is usually ``dev`` or ``prod``.
* ``SYMFONY_DEBUG`, controls whether the command should enable the debug features
  of Symfony, which is usually ``true`` for the ``dev`` environment and ``false``
  for the ``prod`` environment.

@xabbuh
Copy link
Member

xabbuh commented Dec 16, 2014

What about adding it to http://symfony.com/doc/current/cookbook/configuration/environments.html (specifically under "Executing an Application in different Environments")?

@javiereguiluz
Copy link
Member

@xabbuh thanks for your suggestion. I've added the new docs in #4665.

weaverryan added a commit that referenced this issue Dec 22, 2014
…iluz)

This PR was merged into the 2.3 branch.

Discussion
----------

Documented the console environment variables

| Q             | A
| ------------- | ---
| Doc fix?      | no
| New docs?     | yes
| Applies to    | all
| Fixed tickets | #4162

Commits
-------

df2a0f2 Fixes and tweaks
dd8157f More tweaks and grammar fixes
2fb082d Rewordings and transformed a list into a definition list
a1d88d8 More grammar fixes
8ead4a4 Minor grammar fix
6fc8f4c Fixed some errors in the explanation
7c4cd17 Documented the console environment variables
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
actionable Clear and specific issues ready for anyone to take them. DX good first issue Ideal for your first contribution! (some Symfony experience may be required)
Projects
None yet
Development

No branches or pull requests

5 participants