From ecd9e615a03b745df194a52972d7deacb18934ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Sch=C3=A4dlich?= Date: Thu, 20 Jun 2019 09:08:37 +0200 Subject: [PATCH] Add example for env var processor: trim --- configuration/env_var_processors.rst | 37 ++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/configuration/env_var_processors.rst b/configuration/env_var_processors.rst index 1c4eeb758df..98bffbe3d7d 100644 --- a/configuration/env_var_processors.rst +++ b/configuration/env_var_processors.rst @@ -376,6 +376,43 @@ Symfony provides the following env var processors: and end of the string. This is especially useful in combination with the ``file`` processor, as it'll remove newlines at the end of a file. + .. configuration-block:: + + .. code-block:: yaml + + # config/packages/framework.yaml + parameters: + env(AUTH_FILE): '../config/auth.json' + google: + auth: '%env(trim:file:AUTH_FILE)%' + + .. code-block:: xml + + + + + + + ../config/auth.json + + + + + + .. code-block:: php + + // config/packages/framework.php + $container->setParameter('env(AUTH_FILE)', '../config/auth.json'); + $container->loadFromExtension('google', [ + 'auth' => '%env(trim:file:AUTH_FILE)%', + ]); + .. versionadded:: 4.3 The ``trim`` processor was introduced in Symfony 4.3.