diff --git a/classes/BasicSpecialFunction.php b/classes/BasicSpecialFunction.php index 602c7eec8af535d9499aa2971d2c08ad71e45d10..eed8fbee11fedf58d5cd78ee65f04199af573731 100644 --- a/classes/BasicSpecialFunction.php +++ b/classes/BasicSpecialFunction.php @@ -46,21 +46,6 @@ class SpecialFunction extends AbstractSpecialFunction{ $endpoints = $context['endpoints']; array_pop($params); array_shift($params); - //$query = file_get_contents($conf['model']['directory'].$modelFile); - /*$queryHeader = ""; - $prefixHeader = array(); - for($i=0;$i<sizeof($params);$i++){ - $auxPrefix = Utils::getPrefix($params[$i]); - if($auxPrefix['ns'] != NULL){ - $prefixHeader[$auxPrefix['ns']] = $auxPrefix['prefix']; - } - $query = preg_replace("|%".$i."|", $params[$i], $query); - } - foreach($prefixHeader as $n => $p){ - $queryHeader .= "PREFIX $p: <$n> \n"; - } - $data['query'] =$queryHeader . $query;*/ - //$e->query($data['query'], Utils::getResultsType($query)); $prefixHeader = array(); for($i=0;$i<sizeof($params);$i++){ @@ -97,7 +82,7 @@ class SpecialFunction extends AbstractSpecialFunction{ $base['model']['directory'] = $conf['home'].$conf['model']['directory']; chdir($conf['model']['directory']); Utils::queryFile($modelFile, $endpoints['local'], $data); - chdir(".."); + chdir($conf['home']); $data = Utils::internalize($data); if(is_array($data)){ diff --git a/classes/Utils.php b/classes/Utils.php index e1cb69feb3b0c14a44d1a2e218ac0399c9f792db..6002caa4a753b2d472e250bd8fa01a4068c14a15 100644 --- a/classes/Utils.php +++ b/classes/Utils.php @@ -12,7 +12,7 @@ class Utils{ public static function send404($uri){ header("HTTP/1.0 404 Not Found"); - echo "I could not find ".$uri." or information about it.\n\n"; + echo "LODSPeaKr could not find ".$uri." or information about it.\n\n"; exit(0); } @@ -272,7 +272,7 @@ class Utils{ Utils::queryDir($v, $r); } } - chdir(".."); + chdir($conf['home']); //return $data; } diff --git a/index.php b/index.php index d0f06e6a185eda0aa323fd53451f8f37432bbf5d..577d3a83e5d78bc7aef666291fefc3da08990317 100755 --- a/index.php +++ b/index.php @@ -128,7 +128,7 @@ chdir($conf['model']['directory']); Utils::queryFile($modelFile, $endpoints['local'], $results, $first); $results = Utils::internalize($results); $base['first'] = Utils::getFirsts($results); -chdir(".."); +chdir($conf['home']); if(is_array($results)){ $resultsObj = Convert::array_to_object($results); }else{ diff --git a/install.sh b/install.sh index b03bd452d7ada372fc2a6c92a2bbbdd09a2ae2fb..fb259b95b3eeea5fddf9563ebffcd62958ec9a0e 100755 --- a/install.sh +++ b/install.sh @@ -27,7 +27,7 @@ while [ "$everything_ok" != "y" ]; do echo echo "LODSPeaKr needs to know three (3) URIs to minimally configure itself:" echo - echo "(1/3) At what URL will `pwd` be available? (e.g. http://localhost/$parent/)" + echo "(1/3) At what URL will `pwd |sed -e 's/lodspeakr$//'` be available? (e.g. http://localhost/$parent/)" echo "**Note** DO NOT include 'lodspeakr/' in the URL" echo -n "(default '$basedir'): " read -u 1 aux_basedir