File tree 1 file changed +37
-0
lines changed
1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -376,6 +376,43 @@ Symfony provides the following env var processors:
376
376
and end of the string. This is especially useful in combination with the
377
377
``file `` processor, as it'll remove newlines at the end of a file.
378
378
379
+ .. configuration-block ::
380
+
381
+ .. code-block :: yaml
382
+
383
+ # config/services.yaml
384
+ parameters :
385
+ env(AUTH_FILE) : ' ../config/auth.json'
386
+ google :
387
+ auth : ' %env(trim:file:AUTH_FILE)%'
388
+
389
+ .. code-block :: xml
390
+
391
+ <!-- config/packages/framework.xml -->
392
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
393
+ <container xmlns =" http://symfony.com/schema/dic/services"
394
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
395
+ xmlns : framework =" http://symfony.com/schema/dic/symfony"
396
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services
397
+ https://symfony.com/schema/dic/services/services-1.0.xsd
398
+ http://symfony.com/schema/dic/symfony
399
+ https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
400
+
401
+ <parameters >
402
+ <parameter key =" env(AUTH_FILE)" >../config/auth.json</parameter >
403
+ </parameters >
404
+
405
+ <google auth =" %env(trim:file:AUTH_FILE)%" />
406
+ </container >
407
+
408
+ .. code-block :: php
409
+
410
+ // config/packages/framework.php
411
+ $container->setParameter('env(AUTH_FILE)', '../config/auth.json');
412
+ $container->loadFromExtension('google', [
413
+ 'auth' => '%env(trim:file:AUTH_FILE)%',
414
+ ]);
415
+
379
416
.. versionadded :: 4.3
380
417
381
418
The ``trim `` processor was introduced in Symfony 4.3.
You can’t perform that action at this time.
0 commit comments