set proper exit status when config file does not exist
This commit is contained in:
parent
a484c99273
commit
7b50608138
1 changed files with 7 additions and 9 deletions
|
@ -32,18 +32,15 @@ $cfg = new SemanticScuttle_Config();
|
||||||
list($configfile, $defaultfile) = $cfg->findFiles();
|
list($configfile, $defaultfile) = $cfg->findFiles();
|
||||||
if ($defaultfile === null) {
|
if ($defaultfile === null) {
|
||||||
header('HTTP/1.0 500 Internal Server Error');
|
header('HTTP/1.0 500 Internal Server Error');
|
||||||
die(
|
echo 'No default configuration file config.default.php found.'
|
||||||
'No default configuration file config.default.php found.'
|
|
||||||
. ' This is really, really strange'
|
. ' This is really, really strange'
|
||||||
. "\n"
|
. "\n";
|
||||||
);
|
exit(1);
|
||||||
}
|
}
|
||||||
if ($configfile === null) {
|
if ($configfile === null) {
|
||||||
header('HTTP/1.0 500 Internal Server Error');
|
header('HTTP/1.0 500 Internal Server Error');
|
||||||
die(
|
echo 'Please copy "config.php.dist" to "config.php" in data/ folder.' . "\n";
|
||||||
'Please copy "config.php.dist" to "config.php" in data/ folder.'
|
exit(1);
|
||||||
. "\n"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
set_include_path(
|
set_include_path(
|
||||||
get_include_path() . PATH_SEPARATOR
|
get_include_path() . PATH_SEPARATOR
|
||||||
|
@ -58,7 +55,8 @@ if (isset($_GET['unittestMode']) && $_GET['unittestMode'] == 1
|
||||||
) {
|
) {
|
||||||
if ($allowUnittestMode !== true) {
|
if ($allowUnittestMode !== true) {
|
||||||
header('HTTP/1.0 400 Bad Request');
|
header('HTTP/1.0 400 Bad Request');
|
||||||
die("Unittestmode is not allowed\n");
|
echo "Unittestmode is not allowed\n";
|
||||||
|
exit(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
define('HTTP_UNIT_TEST_MODE', true);
|
define('HTTP_UNIT_TEST_MODE', true);
|
||||||
|
|
Loading…
Reference in a new issue