summaryrefslogtreecommitdiff
path: root/src/SemanticScuttle/header.php
diff options
context:
space:
mode:
authorChristian Weiske <cweiske@cweiske.de>2011-07-21 21:32:48 +0200
committerChristian Weiske <cweiske@cweiske.de>2011-07-21 21:32:48 +0200
commit82ee59779ea9a5d2d9234e622f56cfcc4c22ff3a (patch)
tree8dbaba53a257464942d71c66a559944b949fdb9b /src/SemanticScuttle/header.php
parent846e3a38cf049266a33cb3e553fcacbcbdc0bfa3 (diff)
downloadsemanticscuttle-82ee59779ea9a5d2d9234e622f56cfcc4c22ff3a.tar.gz
semanticscuttle-82ee59779ea9a5d2d9234e622f56cfcc4c22ff3a.tar.bz2
support global and per-host configuration files
Diffstat (limited to 'src/SemanticScuttle/header.php')
-rw-r--r--src/SemanticScuttle/header.php17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/SemanticScuttle/header.php b/src/SemanticScuttle/header.php
index 6c0d4df..9252300 100644
--- a/src/SemanticScuttle/header.php
+++ b/src/SemanticScuttle/header.php
@@ -25,8 +25,19 @@ 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__) . '/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 +50,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
) {