配置格式

2021-09-27 10:57:29
admin
1326
最后编辑:admin 于 2022-10-26 11:21:03

zentaoPHP 框架中所有配置文件的定义格式均采用 PHP 对象的方式,应用创建的同时,框架会自动加载公共配置文件并生成全局配置对象 $config。

配置格式为:

<?php
$config->installed    = true;  
$config->debug        = true;  
$config->requestType  = 'GET';    // PATH_INFO 、PATH_INFO2 、 GET
$config->requestFix   = '-';
$config->webRoot      = '/'; 
$config->db->host     = 'localhost';
$config->db->port     = '3306';
$config->db->name     = 'demo'; 
$config->db->user     = 'root'; 
$config->db->password = '';

采用对象的方式来引用,要比数组的方式简洁流畅的多。