thelia/thelia — pull request #968 by lunika (2014-12-08 11:38:34+00:00)
Title: parameter config for database managed by a ParameterBag and can use env variables

With this PR, it is now possible to use environment variables instead of hard coding database credentials.

The HttpKernel component already has this feature so I reuse it in Thelia so you stil have the use the prefix SYMFONY__, the documentation is here : http://symfony.com/fr/doc/2.3/cookbook/configuration/external_parameters.html

For exemple, my current database.yml file :

```
database:
connection:
driver: %database.driver%
user: %database.user%
password: %database.pwd%
dsn: mysql:host=%database.host%;dbname=%database.db_name%;port=3306
```

and the variable in my Vhost :

```
SetEnv SYMFONY__DATABASE__USER foo
SetEnv SYMFONY__DATABASE__PWD bar
SetEnv SYMFONY__DATABASE__DRIVER mysql
SetEnv SYMFONY__DATABASE__HOST localhost
SetEnv SYMFONY__DATABASE__DB_NAME thelia
```

As you can see I have no more my credentials in this file and I follow the rule 3 defined in the 12 factor manifest : http://12factor.net/config

You can now add your config.yml file in your versionning system and deploy easily your thelia.