Commit 6c868aa6 authored by Nigel McNie's avatar Nigel McNie

Load config-defaults.php before looking in the database.

If we don't, defaults for log levels and other such things aren't
specified, which can lead to problems when an error occurs while
connecting to the database.
parent 699a65fd
......@@ -57,6 +57,8 @@ init_performance_info();
require('config.php');
$CFG = (object)array_merge((array)$cfg, (array)$CFG);
require_once('config-defaults.php');
$CFG = (object)array_merge((array)$cfg, (array)$CFG);
// Fix up paths in $CFG
foreach (array('docroot', 'dataroot') as $path) {
......@@ -126,9 +128,6 @@ try {
catch (SQLException $e) {
db_ignore_sql_exceptions(false);
}
// now that we've gotten through the database config
// (or not, for a new install), load the config-defaults.php config.
load_default_config();
// Make sure wwwroot is set and available, either in the database or int the
// config file. Cron requires it for some purposes.
......
......@@ -547,15 +547,6 @@ function load_config() {
return true;
}
function load_default_config() {
global $CFG;
require_once(get_config('docroot') . 'config-defaults.php');
$CFG = (object)array_merge((array)$cfg, (array)$CFG);
return true;
}
/**
* This function returns a value from $CFG
* or null if it is not found
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment