config 文件夹中的 main.php 和 main-local.php 的区别? [英] Difference between main.php and main-local.php in the config folder?

查看:20
本文介绍了config 文件夹中的 main.php 和 main-local.php 的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能解释一下config文件夹中ma​​in.phpma​​in-local.php的区别?

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

为什么一个有 -local,而另一个没有?

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

推荐答案

您可以阅读 配置和环境 部分 高级应用程序模板 README 以了解这一点:

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

通常环境包含应用程序引导文件,例如index.php 和后缀为 -local.php 的配置文件.这些是添加的到 .gitignore 并且从未添加到源代码存储库中.

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

按以下顺序读取参数:

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.

这篇关于config 文件夹中的 main.php 和 main-local.php 的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆