Skip to content

Commit aa83c1b

Browse files
committed
minor #15306 [FrameworkBundle] Document env vars in framework.ide (javiereguiluz)
This PR was squashed before being merged into the 5.3-dev branch. Discussion ---------- [FrameworkBundle] Document env vars in framework.ide This fixes #15303. `@MatTheCat`, please review this. Thank you! Commits ------- 7f580b7 [FrameworkBundle] Document env vars in framework.ide
2 parents 1cb4e7f + 7f580b7 commit aa83c1b

File tree

1 file changed

+46
-4
lines changed

1 file changed

+46
-4
lines changed

reference/configuration/framework.rst

Lines changed: 46 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -461,10 +461,52 @@ doubling them to prevent Symfony from interpreting them as container parameters)
461461
};
462462
463463
Since every developer uses a different IDE, the recommended way to enable this
464-
feature is to configure it on a system level. This can be done by setting the
465-
``xdebug.file_link_format`` option in your ``php.ini`` configuration file. The
466-
format to use is the same as for the ``framework.ide`` option, but without the
467-
need to escape the percent signs (``%``) by doubling them:
464+
feature is to configure it on a system level. First, you can set its value to
465+
some environment variable that stores the name of the IDE/editor:
466+
467+
.. configuration-block::
468+
469+
.. code-block:: yaml
470+
471+
# config/packages/framework.yaml
472+
framework:
473+
# the env var stores the IDE/editor name (e.g. 'phpstorm', 'vscode', etc.)
474+
ide: '%env(resolve:CODE_EDITOR)%'
475+
476+
.. code-block:: xml
477+
478+
<!-- config/packages/framework.xml -->
479+
<?xml version="1.0" encoding="UTF-8" ?>
480+
<container xmlns="http://symfony.com/schema/dic/services"
481+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
482+
xmlns:framework="http://symfony.com/schema/dic/symfony"
483+
xsi:schemaLocation="http://symfony.com/schema/dic/services
484+
https://symfony.com/schema/dic/services/services-1.0.xsd
485+
http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
486+
487+
<!-- the env var stores the IDE/editor name (e.g. 'phpstorm', 'vscode', etc.) -->
488+
<framework:config ide="%env(resolve:CODE_EDITOR)%"/>
489+
</container>
490+
491+
.. code-block:: php
492+
493+
// config/packages/framework.php
494+
use Symfony\Config\FrameworkConfig;
495+
496+
return static function (FrameworkConfig $framework) {
497+
// the env var stores the IDE/editor name (e.g. 'phpstorm', 'vscode', etc.)
498+
$framework->ide('%env(resolve:CODE_EDITOR)%');
499+
};
500+
501+
.. versionadded:: 5.3
502+
503+
The option to use env vars in the ``framework.ide`` option was introduced
504+
in Symfony 5.3.
505+
506+
Another alternative is to set the ``xdebug.file_link_format`` option in your
507+
``php.ini`` configuration file. The format to use is the same as for the
508+
``framework.ide`` option, but without the need to escape the percent signs
509+
(``%``) by doubling them:
468510

469511
.. code-block:: ini
470512

0 commit comments

Comments
 (0)