thinkphp 配置加载

状态配置

每个应用都可以在不同的情况下设置自己的状态(或者称之为应用场景),并且加载不同的配置文件。

举个例子,你需要在公司和家里分别设置不同的数据库测试环境。那么可以这样处理,在公司环境中,我们在入口文件中定义:

    define('APP_STATUS','office');

那么就会自动加载该状态对应的配置文件(位于Application/Common/Conf/office.php)。

如果我们回家后,我们修改定义为:

    define('APP_STATUS','home');

那么就会自动加载该状态对应的配置文件(位于Application/Common/Conf/home.php)。

 

posted @ 2017-09-27 18:31  侠岚之弋痕夕  阅读(147)  评论(0编辑  收藏  举报
Where is the starting point, we don't have a choice, but the destination where we can pursue!