У меня есть этот файл 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']);
Вот база данных.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';
Вот сайт.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;
Что я делаю не так?