Add HTTP status code for $databaseConfig error (fixes #3392)

This commit is contained in:
Loz Calver 2014-08-18 09:12:26 +01:00
parent 17bdc2dea1
commit b27cd73cb9

View File

@ -158,6 +158,7 @@ global $databaseConfig;
// Redirect to the installer if no database is selected // Redirect to the installer if no database is selected
if(!isset($databaseConfig) || !isset($databaseConfig['database']) || !$databaseConfig['database']) { if(!isset($databaseConfig) || !isset($databaseConfig['database']) || !$databaseConfig['database']) {
if(!file_exists(BASE_PATH . '/install.php')) { if(!file_exists(BASE_PATH . '/install.php')) {
header($_SERVER['SERVER_PROTOCOL'] . " 500 Server Error");
die('SilverStripe Framework requires a $databaseConfig defined.'); die('SilverStripe Framework requires a $databaseConfig defined.');
} }
$s = (isset($_SERVER['SSL']) || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')) ? 's' : ''; $s = (isset($_SERVER['SSL']) || (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off')) ? 's' : '';