On config errors do not exit but throw exception
This commit is contained in:
@@ -183,8 +183,9 @@ if (file_exists(BASE . CONFIGS . 'config.path.php')) {
|
|||||||
define('HOST_NAME', $HOST_NAME);
|
define('HOST_NAME', $HOST_NAME);
|
||||||
// BAIL ON MISSING MASTER SITE CONFIG
|
// BAIL ON MISSING MASTER SITE CONFIG
|
||||||
if (!isset($SITE_CONFIG[HOST_NAME]['location'])) {
|
if (!isset($SITE_CONFIG[HOST_NAME]['location'])) {
|
||||||
echo 'Missing SITE_CONFIG entry for: "' . HOST_NAME . '". Contact Administrator';
|
throw new \InvalidArgumentException(
|
||||||
exit(1);
|
'Missing SITE_CONFIG entry for: "' . HOST_NAME . '". Contact Administrator'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
// BAIL ON MISSING DB CONFIG:
|
// BAIL ON MISSING DB CONFIG:
|
||||||
// we have either no db selction for this host but have db config entries
|
// we have either no db selction for this host but have db config entries
|
||||||
@@ -200,8 +201,9 @@ if (
|
|||||||
empty($DB_CONFIG[$SITE_CONFIG[HOST_NAME]['db_host']]))
|
empty($DB_CONFIG[$SITE_CONFIG[HOST_NAME]['db_host']]))
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
echo 'No matching DB config found for: "' . HOST_NAME . '". Contact Administrator';
|
throw new \InvalidArgumentException(
|
||||||
exit(1);
|
'No matching DB config found for: "' . HOST_NAME . '". Contact Administrator'
|
||||||
|
);
|
||||||
}
|
}
|
||||||
// set SSL on
|
// set SSL on
|
||||||
$is_secure = false;
|
$is_secure = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user