zoukankan      html  css  js  c++  java
  • ThinkPHP5 配置文件

    配置目录

    系统默认的配置文件目录就是应用目录(APP_PATH),也就是默认的application下面,并分为应用配置(整个应用有效)和模块配置(仅针对该模块有效)。

    ├─application         应用目录
    │  ├─config.php       应用配置文件
    │  ├─database.php     数据库配置文件
    │  ├─route.php        路由配置文件
    │  ├─index            index模块配置文件目录
    │  │  ├─config.php    index模块配置文件
    │  │  └─database.php  index模块数据库配置文件


    如果不希望配置文件放到应用目录下面,可以在入口文件中定义独立的配置目录,添加CONF_PATH常量定义即可,例如:
    // 定义配置文件目录和应用目录同级
    define('CONF_PATH', __DIR__.'/../config/');
    ├─application         应用目录
    ├─config              配置目录
    │  ├─config.php       应用配置文件
    │  ├─database.php     数据库配置文件
    │  ├─route.php        路由配置文件
    │  ├─index            index模块配置文件目录
    │  │  ├─config.php    index模块配置文件
    │  │  └─database.php  index模块数据库配置文件


    如果想要修改默认输出类型 default_return_type,可以到 application/config.php 中修改,即在应用配置文件中修改。
  • 相关阅读:
    应届毕业生简历撰写技巧
    【LeetCode】- Longest Substring Without Repeating Characters
    线性规划
    什么是凸规划
    最优化算法 (一)
    香农定理和频谱效率
    虚函数的用法
    QT学习一
    努力!
    Qslider
  • 原文地址:https://www.cnblogs.com/ryanzheng/p/10024334.html
Copyright © 2011-2022 走看看