我有这个 index.php 文件
# Loading configurations.
loadConfiguration('database');
loadConfiguration('site');
# Initializing the database connection.
$db = new database($c['db']['host'], $c['db']['username'], $c['db']['password'], $c['db']['name']);
unset($c['db']['password']);
并且 loadConfiguration() 设置如下:
function loadConfiguration($string) { require(path.'config/'.$string.'.con.php'); }
我检查了 database.con.php 和 site.con.php 是否在 config/ 文件夹中。我得到的唯一错误是通知:未定义变量:以下行中的c
$db = new database($c['db']['host'], $c['db']['username'], $c['db']['password'], $c['db']['name']);
这是database.con.php
# Ignore.
if (!defined('APP_ON')) { die('Feel the rain...'); }
$c['db']['host'] = 'localhost';
$c['db']['username'] = 'root';
$c['db']['password'] = '';
$c['db']['name'] = 'name';
这是 site.con.php
# Ignore.
if (!defined('APP_ON')) { die('Feel the rain...'); }
/* Site informations */
$c['site']['name'] = 'Namek';
$c['site']['mail'] = 'mail@whocares.com';
$c['site']['enable-email'] = false;
$c['site']['debug-mode'] = true;
我究竟做错了什么?