Difference between main.php and main-local.php in the config folder?

可紊 提交于 2019-12-10 01:52:55

问题


Can anyone please explain the difference between main.php and main-local.php in the config folder?

Why one has the -local, and the other doesn't?


回答1:


You can read Configuration and environments section of Advanced Application Template README to understand this:

Typically environment contains application bootstrap files such as index.php and config files suffixed with -local.php. These are added to .gitignore and never added to source code repository.

In order to avoid duplication configurations are overriding each other. For example, the frontend reads configuration in the following order:

common/config/main.php
common/config/main-local.php
frontend/config/main.php
frontend/config/main-local.php

Parameters are read in the following order:

common/config/params.php
common/config/params-local.php
frontend/config/params.php
frontend/config/params-local.php

The later config file overrides the former.



来源:https://stackoverflow.com/questions/28491231/difference-between-main-php-and-main-local-php-in-the-config-folder

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!