ThinkPHP项目笔记之数据库配置篇

对于配置文件,有几点说明

common:公共配置,也就是前台,后台,都可以调用的文件,具有普遍性

前台/后台:就是针对前后台的配置文件,具有针对性。

如:(公共文件基本配置)

<?php
return array(
    //'配置项'=>'配置值'
    'DB_TYPE'                   =>  'mysql',
    'DB_HOST'                   =>  'localhost',
    'DB_NAME'                   =>  'db_name',
    'DB_USER'                   =>  'root',
    'DB_PWD'                    =>  'root',
    'DB_PORT'                   =>  '3306',
    'DB_PREFIX'                 =>  'pre_',
    'DB_CHARSET'                =>  'utf8',

    
    'MODULE_ALLOW_LIST' => array('Home','Manage','User'),
    'DEFAULT_MODULE' => 'Home',
     'TAG_NESTED_LEVEL' =>5,
);

当然,这是基本的配置,还可以根据开发的需求,配置路由,常量等等。

 

posted @ 2016-02-16 14:05  侠岚之弋痕夕  阅读(190)  评论(0编辑  收藏  举报
Where is the starting point, we don't have a choice, but the destination where we can pursue!