Merge pull request #3399 from kinglozzer/pulls/dbconfig-response-code

Add HTTP status code for $databaseConfig error (fixes #3392)
This commit is contained in:
Sean Harvey 2014-08-18 20:54:40 +12:00
commit 7659ebab8e

View File

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