Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passing "null" encryption from parameters.ini and using it in config.yml

I am trying to set a null value in app/config/parameters.ini and use it in app/config/config.yml for the swiftmailer.encryption config parameter. I need to set it in parameters.ini because I have different environments that each use different mail configuration.

The Symfony documentation says that this config parameter should be a string value and that "valid values are tls, ssl, or null".

My first guess would be to add mailer_encryption="null" to parameters.ini and encryption: %mailer_encryption% to config.yml. But that results in an error:

"InvalidConfigurationException: Invalid configuration for path "swiftmailer.encryption": The "null" encryption is not supported".

If I use mailer_encryption=null or mailer_encryption= in parameters.ini, I get another error:

"InvalidConfigurationException: Invalid configuration for path "swiftmailer.encryption": The "" encryption is not supported".

If I stop referencing the parameter by changing config.yml to encryption:, it works but this doesn't solve my objective.

I am using Symfony 2.0.15, which includes Swiftmailer with it. This is the 2.0 branch.

How can I get this working?

like image 925
mattalxndr Avatar asked Oct 05 '22 19:10

mattalxndr


1 Answers

AFAIK, you can use yml format of parameters file. So try to create parameters.yml and import it to your config.yml

like image 138
Ziumin Avatar answered Oct 10 '22 03:10

Ziumin