Symfony configuration cascade

In Symfony 1.4, you can define a custom configuration file (for example, my_config.yml) that allows cascading; for example, with a global user configuration file and an analog module?

+4
source share
1 answer

Yes.

Define a configuration handler in config_handlers.yml . It probably looks like this:

 config/my_config.yml: class: myConfigHandler 

Write your configuration handler. For an example you can look at many other configuration handlers in lib/config . You probably want to expand sfYamlConfigHandler .

To access your configuration values:

 sfContext::getInstance()->getConfigCache()->checkConfig('/config/my_config.yml'); 
+2
source

All Articles