summaryrefslogtreecommitdiff
path: root/src/SemanticScuttle/header.php
diff options
context:
space:
mode:
authorYalçın Can <ylcncn@gmail.com>2011-07-27 14:23:37 +0300
committerYalçın Can <ylcncn@gmail.com>2011-07-27 14:23:37 +0300
commitefd842174fdd37f8eb2c460c7adb21954bcfbe9d (patch)
treea2ab3cc25db92b901b69ce1bc0ad1dedb5d498ef /src/SemanticScuttle/header.php
parent8cd40b3d76e191b2fbe95b044f69aed07cc27664 (diff)
parent81aa17b8523d95310c90366d9af09767db0c84f2 (diff)
downloadsemanticscuttle-efd842174fdd37f8eb2c460c7adb21954bcfbe9d.tar.gz
semanticscuttle-efd842174fdd37f8eb2c460c7adb21954bcfbe9d.tar.bz2
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/SemanticScuttle/header.php')
-rw-r--r--src/SemanticScuttle/header.php18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/SemanticScuttle/header.php b/src/SemanticScuttle/header.php
index 6c0d4df..694df54 100644
--- a/src/SemanticScuttle/header.php
+++ b/src/SemanticScuttle/header.php
@@ -25,8 +25,20 @@ if ('@data_dir@' == '@' . 'data_dir@') {
//FIXME: when you have multiple installations, the www_dir will be wrong
$wwwdir = '@www_dir@/SemanticScuttle/';
}
+require_once dirname(__FILE__) . '/Environment.php';
+require_once dirname(__FILE__) . '/Config.php';
-if (!file_exists($datadir . '/config.php')) {
+$cfg = new SemanticScuttle_Config();
+list($configfile, $defaultfile) = $cfg->findFiles();
+if ($defaultfile === null) {
+ header('HTTP/1.0 500 Internal Server Error');
+ die(
+ 'No default configuration file config.default.php found.'
+ . ' This is really, really strange'
+ . "\n"
+ );
+}
+if ($configfile === null) {
header('HTTP/1.0 500 Internal Server Error');
die(
'Please copy "config.php.dist" to "config.php" in data/ folder.'
@@ -39,8 +51,8 @@ set_include_path(
);
// 1 // First requirements part (before debug management)
-require_once $datadir . '/config.default.php';
-require_once $datadir . '/config.php';
+require_once $defaultfile;
+require_once $configfile;
if (isset($_GET['unittestMode']) && $_GET['unittestMode'] == 1
) {