公用配置文件

来源:互联网 发布:盖亚网络 编辑:程序博客网 时间:2024/04/28 13:25

建立前后台公用的配置文件

在Index、Admin同级的文件夹中建一个Conf文件建一个config.php文件

<?php

return array(

   'DB_HOST' => 'localhost',

   'DB_NAME' => 'jxdb',

   'DB_USER' => 'root',

'DB_PWD' =>''

);

?>

然后可以分别在Index,Admin的config写上自己私有的配置文件,再引用共用的配置文件

<?php

$config= array(

    写上自己私有的配置项

 

         //'配置项'=>'配置值'

);

return array_merge(include'./Conf/config.php',$config);

?>

0 0
原创粉丝点击