8000 [FrameworkBundle] Document env vars in framework.ide by javiereguiluz · Pull Request #15306 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[FrameworkBundle] Document env vars in framework.ide #15306

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

Merged
merged 1 commit into from
May 4, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 46 additions & 4 deletions reference/configuration/framework.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

<!-- config/packages/framework.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<container xmlns="http://symfony.com/schema/dic/services"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:framework="http://symfony.com/schema/dic/symfony"
xsi:schemaLocation="http://symfony.com/schema/dic/services
https://symfony.com/schema/dic/services/services-1.0.xsd
http://symfony.com/schema/dic/symfony https://symfony.com/schema/dic/symfony/symfony-1.0.xsd">

<!-- the env var stores the IDE/editor name (e.g. 'phpstorm', 'vscode', etc.) -->
<framework:config ide="%env(resolve:CODE_EDITOR)%"/>
</container>

.. 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

Expand Down
0