$this->basepath = rtrim($basepath, DIRECTORY_SEPARATOR);
- // The order of the following calls is important to ensure proper initialization
- $this->loadConfigFiles();
-
- $this->loadDatabase();
-
- $this->determineMode();
-
- $this->determineUrlPath();
-
- Config::load();
-
- if ($this->mode & self::MODE_DBAVAILABLE) {
- Core\Addon::loadHooks();
-
- $this->loadAddonConfig();
- }
-
- $this->loadDefaultTimezone();
-
$this->performance['start'] = microtime(true);
$this->performance['database'] = 0;
$this->performance['database_write'] = 0;
$this->callstack['rendering'] = [];
$this->callstack['parser'] = [];
+ // The order of the following calls is important to ensure proper initialization
+ $this->loadConfigFiles();
+
+ $this->loadDatabase();
+
+ $this->determineMode();
+
+ $this->determineUrlPath();
+
+ Config::load();
+
+ if ($this->mode & self::MODE_DBAVAILABLE) {
+ Core\Addon::loadHooks();
+
+ $this->loadAddonConfig();
+ }
+
+ $this->loadDefaultTimezone();
+
$this->page = [
'aside' => '',
'bottom' => '',
$a = $this;
include $this->basepath . DIRECTORY_SEPARATOR . '.htconfig.php';
+
+ $this->setConfigValue('database', 'hostname', $db_host);
+ $this->setConfigValue('database', 'username', $db_user);
+ $this->setConfigValue('database', 'password', $db_pass);
+ $this->setConfigValue('database', 'database', $db_data);
+ if (isset($a->config['system']['db_charset'])) {
+ $this->setConfigValue('database', 'charset', $a->config['system']['db_charset']);
+ }
+
unset($db_host, $db_user, $db_pass, $db_data);
if (isset($default_timezone)) {
$this->setConfigValue('system', 'pidfile', $pidfile);
unset($pidfile);
}
+
+ if (isset($lang)) {
+ $this->setConfigValue('system', 'language', $lang);
+ unset($lang);
+ }
}
if (file_exists($this->basepath . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . 'local.ini.php')) {
}
$db_pass = (string) getenv('MYSQL_PASSWORD');
$db_data = getenv('MYSQL_DATABASE');
- } elseif (file_exists($this->basepath . DIRECTORY_SEPARATOR . '.htconfig.php')) {
- $a = new \stdClass();
- include $this->basepath . DIRECTORY_SEPARATOR . '.htconfig.php';
- $charset = isset($a->config["system"]["db_charset"]) ? $a->config["system"]["db_charset"] : $charset;
-
- unset($a);
}
$stamp1 = microtime(true);
\dba::connect($db_host, $db_user, $db_pass, $db_data, $charset);
unset($db_host, $db_user, $db_pass, $db_data, $charset);
- $this->save_timestamp($stamp1, "network");
+ $this->save_timestamp($stamp1, 'network');
}
/**