zoukankan      html  css  js  c++  java
  • thinkphp3.22 多项目配置

    1.index.php

    if(version_compare(PHP_VERSION,'5.3.0','<'))  die('require PHP > 5.3.0 !');
    // 开启调试模式 建议开发阶段开启 部署阶段注释或者设为false
    define('APP_DEBUG',true);
    // 创建
    //define('BIND_MODULE','Login');
    define('erp',true);
    // 定义应用目录
    define('APP_PATH','./App/');
    // 安装目录
    define('WEB_PATH', 'erp/');   // 子目录
    //上传目录
    define('UPLOAD_PATH',  WEB_PATH.'Upload/');
    // 引入ThinkPHP入口文件
    require './ThinkPHP/ThinkPHP.php';
    
    // 亲^_^ 后面不需要任何代码了 就是如此简

    BIND_MODULE 创建项目(带Common,Conf,Controller,Lang,Model,View,index.html)

    2.项目配置config.php

    <?php
    return array(
        //'配置项'=>'配置值'
        
        'DB_HOST'   => 'localhost', // 服务器地址
        'DB_NAME'   => 'erp', // 数据库名
        'DB_USER'   => 'root', // 用户名
        'DB_PWD'    => 'root', // 密码
        'DB_PORT'   => 3306, // 端口
        'DB_PREFIX' => 'tp_', // 数据库表前缀 
        'DB_CHARSET'=> 'utf8', // 字符集
        //'DB_DEBUG'  =>  true, // 数据库调试模式 开启后可以记录SQL日志 3.2.3新增*
        'DB_TYPE' => 'mysql',    
        
        'DEFAULT_MODULE'        =>  'Login',  // 默认模块
        //URL设置模式
        'URL_MODEL'                =>'0',
        //模板文件CONTROLLER_NAME与ACTION_NAME之间的分割
        'TMPL_FILE_DEPR'          => '_', 
        
    );

    针对全局配置设置

  • 相关阅读:
    设计模式之中介者模式
    解释器模式(行为模式)
    进程池Pool
    Process子类
    multiprocessing
    random
    re
    time和datetime
    logging 日志
    hashlib
  • 原文地址:https://www.cnblogs.com/wesky/p/5783439.html
Copyright © 2011-2022 走看看