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