From 7c4cd17ba9abe065bd79c88eec1382cc64bb6894 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 17 Dec 2014 08:17:32 +0100 Subject: [PATCH 1/7] Documented the console environment variables --- cookbook/configuration/environments.rst | 31 +++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/cookbook/configuration/environments.rst b/cookbook/configuration/environments.rst index c3fd907859f..ee066b0a5ae 100644 --- a/cookbook/configuration/environments.rst +++ b/cookbook/configuration/environments.rst @@ -212,6 +212,37 @@ environment by using this code and changing the environment string. mode. You'll need to enable that in your front controller by calling :method:`Symfony\\Component\\Debug\\Debug::enable`. +Selecting the Environment for Console Commands +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +By default, Symfony commands are executed in the ``dev`` environment and with the +debug mode enabled. Use ``--env`` and ``-no-debug`` options to modify this behavior: + +.. code-block:: bash + + # 'dev' environment and debug enabled + $ php app/console command_name + + # 'prod' environment and debug enabled + $ php app/console command_name --env=prod + + # 'prod' environment and debug disabled + $ php app/console command_name --env=prod --no-debug + +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 execution environment of the command to the value of + this variable. +* ``SYMFONY_DEBUG``, if ``true``, debug mode is enabled for the command. If + ``false``, debug mode is disabled. + +These environment variables are very useful for production servers, because they +allow you to ensure that commands are always run on ``prod`` environment without +having to add any command option. + .. index:: single: Environments; Creating a new environment From 6fc8f4cc5cb9ee6c15479d1c20c103e3b5eda550 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 17 Dec 2014 09:33:52 +0100 Subject: [PATCH 2/7] Fixed some errors in the explanation --- cookbook/configuration/environments.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/cookbook/configuration/environments.rst b/cookbook/configuration/environments.rst index ee066b0a5ae..9338578f522 100644 --- a/cookbook/configuration/environments.rst +++ b/cookbook/configuration/environments.rst @@ -223,11 +223,11 @@ debug mode enabled. Use ``--env`` and ``-no-debug`` options to modify this behav # 'dev' environment and debug enabled $ php app/console command_name - # 'prod' environment and debug enabled + # 'prod' environment (debug is always disabled for 'prod') $ php app/console command_name --env=prod - # 'prod' environment and debug disabled - $ php app/console command_name --env=prod --no-debug + # 'test' environment and debug disabled + $ php app/console command_name --env=test --no-debug In addition to ``--env`` and ``--debug`` options, Symfony commands behavior can also be controlled with environment variables. The Symfony console application @@ -235,9 +235,9 @@ checks the existence and value of these environment variables before executing any command: * ``SYMFONY_ENV``, sets the execution environment of the command to the value of - this variable. -* ``SYMFONY_DEBUG``, if ``true``, debug mode is enabled for the command. If - ``false``, debug mode is disabled. + this variable (``dev``, ``prod``, ``test``, etc.) +* ``SYMFONY_DEBUG``, if ``0``, debug mode is disabled. Otherwise, debug mode is + enabled. These environment variables are very useful for production servers, because they allow you to ensure that commands are always run on ``prod`` environment without From 8ead4a42049b0eb5cc7f7fa2f5a910f840337029 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 17 Dec 2014 14:13:59 +0100 Subject: [PATCH 3/7] Minor grammar fix --- cookbook/configuration/environments.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/configuration/environments.rst b/cookbook/configuration/environments.rst index 9338578f522..ec4b2d9ed78 100644 --- a/cookbook/configuration/environments.rst +++ b/cookbook/configuration/environments.rst @@ -235,7 +235,7 @@ checks the existence and value of these environment variables before executing any command: * ``SYMFONY_ENV``, sets the execution environment of the command to the value of - this variable (``dev``, ``prod``, ``test``, etc.) + this variable (``dev``, ``prod``, ``test``, etc.); * ``SYMFONY_DEBUG``, if ``0``, debug mode is disabled. Otherwise, debug mode is enabled. From a1d88d881bb022381f39e598074a38fc94b05f73 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 17 Dec 2014 14:19:29 +0100 Subject: [PATCH 4/7] More grammar fixes --- cookbook/configuration/environments.rst | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cookbook/configuration/environments.rst b/cookbook/configuration/environments.rst index ec4b2d9ed78..5fbb5bb0669 100644 --- a/cookbook/configuration/environments.rst +++ b/cookbook/configuration/environments.rst @@ -216,7 +216,8 @@ Selecting the Environment for Console Commands ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ By default, Symfony commands are executed in the ``dev`` environment and with the -debug mode enabled. Use ``--env`` and ``-no-debug`` options to modify this behavior: +debug mode enabled. Use the ``--env`` and ``-no-debug`` options to modify this +behavior: .. code-block:: bash @@ -229,8 +230,8 @@ debug mode enabled. Use ``--env`` and ``-no-debug`` options to modify this behav # 'test' environment and debug disabled $ php app/console command_name --env=test --no-debug -In addition to ``--env`` and ``--debug`` options, Symfony commands behavior can -also be controlled with environment variables. The Symfony console application +In addition to the ``--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: From 2fb082d751190d6f6ccbef9942f319549f2958ed Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 17 Dec 2014 14:25:03 +0100 Subject: [PATCH 5/7] Rewordings and transformed a list into a definition list --- cookbook/configuration/environments.rst | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/cookbook/configuration/environments.rst b/cookbook/configuration/environments.rst index 5fbb5bb0669..c2a05382f6f 100644 --- a/cookbook/configuration/environments.rst +++ b/cookbook/configuration/environments.rst @@ -230,15 +230,16 @@ behavior: # 'test' environment and debug disabled $ php app/console command_name --env=test --no-debug -In addition to the ``--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 execution environment of the command to the value of - this variable (``dev``, ``prod``, ``test``, etc.); -* ``SYMFONY_DEBUG``, if ``0``, debug mode is disabled. Otherwise, debug mode is - enabled. +In addition to the ``--env`` and ``--debug`` options, the behavior of Symfony +commands 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 execution environment of the command to the value of this variable + (``dev``, ``prod``, ``test``, etc.); +``SYMFONY_DEBUG`` + If ``0``, debug mode is disabled. Otherwise, debug mode is enabled. These environment variables are very useful for production servers, because they allow you to ensure that commands are always run on ``prod`` environment without From dd8157f2e048de6a99488da562e2bb752bbc8a50 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Wed, 17 Dec 2014 14:26:09 +0100 Subject: [PATCH 6/7] More tweaks and grammar fixes --- cookbook/configuration/environments.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cookbook/configuration/environments.rst b/cookbook/configuration/environments.rst index c2a05382f6f..2033c2af71a 100644 --- a/cookbook/configuration/environments.rst +++ b/cookbook/configuration/environments.rst @@ -241,9 +241,9 @@ executing any command: ``SYMFONY_DEBUG`` If ``0``, debug mode is disabled. Otherwise, debug mode is enabled. -These environment variables are very useful for production servers, because they -allow you to ensure that commands are always run on ``prod`` environment without -having to add any command option. +These environment variables are very useful for production servers because they +allow you to ensure that commands are always run the on ``prod`` environment +without having to add any command option. .. index:: single: Environments; Creating a new environment From df2a0f2668bb353e1e69b096545bd67f8b69480a Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 19 Dec 2014 09:33:56 +0100 Subject: [PATCH 7/7] Fixes and tweaks --- cookbook/configuration/environments.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cookbook/configuration/environments.rst b/cookbook/configuration/environments.rst index 2033c2af71a..b658b16f360 100644 --- a/cookbook/configuration/environments.rst +++ b/cookbook/configuration/environments.rst @@ -216,7 +216,7 @@ Selecting the Environment for Console Commands ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ By default, Symfony commands are executed in the ``dev`` environment and with the -debug mode enabled. Use the ``--env`` and ``-no-debug`` options to modify this +debug mode enabled. Use the ``--env`` and ``--no-debug`` options to modify this behavior: .. code-block:: bash @@ -242,8 +242,8 @@ executing any command: If ``0``, debug mode is disabled. Otherwise, debug mode is enabled. These environment variables are very useful for production servers because they -allow you to ensure that commands are always run the on ``prod`` environment -without having to add any command option. +allow you to ensure that commands always run in the ``prod`` environment without +having to add any command option. .. index:: single: Environments; Creating a new environment