From 7f580b791d5eec393fdb225b1388cdbd2be54783 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 3 May 2021 12:11:57 +0200 Subject: [PATCH] [FrameworkBundle] Document env vars in framework.ide --- reference/configuration/framework.rst | 50 ++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 0ca87286119..d45f35dc742 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -461,10 +461,52 @@ doubling them to prevent Symfony from interpreting them as container parameters) }; Since every developer uses a different IDE, the recommended way to enable this -feature is to configure it on a system level. This can be done by setting the -``xdebug.file_link_format`` option in your ``php.ini`` configuration file. The -format to use is the same as for the ``framework.ide`` option, but without the -need to escape the percent signs (``%``) by doubling them: +feature is to configure it on a system level. First, you can set its value to +some environment variable that stores the name of the IDE/editor: + +.. configuration-block:: + + .. code-block:: yaml + + # config/packages/framework.yaml + framework: + # the env var stores the IDE/editor name (e.g. 'phpstorm', 'vscode', etc.) + ide: '%env(resolve:CODE_EDITOR)%' + + .. code-block:: xml + + + + + + + + + + .. code-block:: php + + // config/packages/framework.php + use Symfony\Config\FrameworkConfig; + + return static function (FrameworkConfig $framework) { + // the env var stores the IDE/editor name (e.g. 'phpstorm', 'vscode', etc.) + $framework->ide('%env(resolve:CODE_EDITOR)%'); + }; + +.. versionadded:: 5.3 + + The option to use env vars in the ``framework.ide`` option was introduced + in Symfony 5.3. + +Another alternative is to set the ``xdebug.file_link_format`` option in your +``php.ini`` configuration file. The format to use is the same as for the +``framework.ide`` option, but without the need to escape the percent signs +(``%``) by doubling them: .. code-block:: ini