File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change @@ -786,6 +786,43 @@ Symfony provides the following env var processors:
786
786
787
787
The ``env(enum:...) `` env var processor was introduced in Symfony 6.2.
788
788
789
+ ``env(defined:NO_FOO) ``
790
+ Evaluates to ``true `` if the env var is defined (ie: different from ``'' `` or ``null ``), ``false `` otherwise.
791
+
792
+ .. configuration-block ::
793
+
794
+ .. code-block :: yaml
795
+
796
+ # config/services.yaml
797
+ parameters :
798
+ typed_env : ' %env(defined:NO_FOO)%'
799
+
800
+ .. code-block :: xml
801
+
802
+ <!-- config/services.xml -->
803
+ <?xml version =" 1.0" encoding =" UTF-8" ?>
804
+ <container xmlns =" http://symfony.com/schema/dic/services"
805
+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
806
+ xmlns : framework =" http://symfony.com/schema/dic/symfony"
807
+ xsi : schemaLocation =" http://symfony.com/schema/dic/services
808
+ https://symfony.com/schema/dic/services/services-1.0.xsd
809
+ http://symfony.com/schema/dic/symfony
810
+ https://symfony.com/schema/dic/symfony/symfony-1.0.xsd" >
811
+
812
+ <parameters >
813
+ <parameter key =" typed_env" ' %env(defined:NO_FOO)%</parameter>
814
+ </parameters>
815
+ </container>
816
+
817
+ .. code-block:: php
818
+
819
+ // config/services.php
820
+ $container->setParameter(' typed_env' , ' %env(defined:NO_FOO)%' );
821
+
822
+ .. versionadded:: 6.4
823
+
824
+ The ``env(defined:...)`` env var processor was introduced in Symfony 6.4.
825
+
789
826
It is also possible to combine any number of processors:
790
827
791
828
.. configuration-block::
You can’t perform that action at this time.
0 commit comments