summaryrefslogtreecommitdiff
path: root/src/SemanticScuttle/constants.php
diff options
context:
space:
mode:
authorcweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-10-03 23:18:49 +0000
committercweiske <cweiske@b3834d28-1941-0410-a4f8-b48e95affb8f>2009-10-03 23:18:49 +0000
commitde031f043f9918424b26534d233df90b7d5c42f9 (patch)
tree679d307a234c71872194f36236cd8d38e3293955 /src/SemanticScuttle/constants.php
parentd5f09b7e4d802cdc2d5f3f876c48ea918c961488 (diff)
downloadsemanticscuttle-de031f043f9918424b26534d233df90b7d5c42f9.tar.gz
semanticscuttle-de031f043f9918424b26534d233df90b7d5c42f9.tar.bz2
make tests run again (though they do not pass)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@389 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'src/SemanticScuttle/constants.php')
-rw-r--r--src/SemanticScuttle/constants.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/SemanticScuttle/constants.php b/src/SemanticScuttle/constants.php
index 4940af8..e37f41c 100644
--- a/src/SemanticScuttle/constants.php
+++ b/src/SemanticScuttle/constants.php
@@ -11,11 +11,14 @@ if(isset($GLOBALS['debugMode'])) {
}
// Determine the base URL as ROOT
-if (!isset($GLOBALS['root'])) {
+if (!isset($_SERVER['HTTP_HOST'])) {
+ //not set in unit tests
+ define('ROOT', 'http://localhost/');
+} else if (!isset($GLOBALS['root'])) {
$pieces = explode('/', $_SERVER['SCRIPT_NAME']);
$rootTmp = '/';
- foreach($pieces as $piece) {
+ foreach ($pieces as $piece) {
//we eliminate possible sscuttle subfolders (like gsearch for example)
if ($piece != '' && !strstr($piece, '.php') && $piece != 'gsearch') {
$rootTmp .= $piece .'/';