search

Home  >  Q&A  >  body text

How does symfony know which configuration file should be used currently?

I took over a new project based on symfony and found that there are many configuration files under /app/config, config_stage.yml, config_production.yml, etc. The system has been using the information in config_stage.yml to connect to the database. Now I need to switch to config_production. yml, don’t know what needs to be changed? After searching the full text, I can't seem to find which file references config_stage.yml.

阿神阿神2758 days ago396

reply all(1)I'll reply

  • 我想大声告诉你

    我想大声告诉你2017-05-16 16:46:36

    .../app/AppKernel.php

    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');
    }
    

    reply
    0
  • Cancelreply