From de031f043f9918424b26534d233df90b7d5c42f9 Mon Sep 17 00:00:00 2001 From: cweiske Date: Sat, 3 Oct 2009 23:18:49 +0000 Subject: 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 --- src/SemanticScuttle/constants.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') 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 .'/'; -- cgit v1.2.3