From ba6a5db773695644ed231570525ae0f19f06edd5 Mon Sep 17 00:00:00 2001 From: alangrafu <alvaro@graves.cl> Date: Wed, 18 Jan 2012 14:31:20 -0800 Subject: [PATCH] Fixed bug with soft links for models and views Instead of returning to ".." it will go to $conf['home'] --- classes/BasicSpecialFunction.php | 17 +---------------- classes/Utils.php | 4 ++-- index.php | 2 +- install.sh | 2 +- 4 files changed, 5 insertions(+), 20 deletions(-) diff --git a/classes/BasicSpecialFunction.php b/classes/BasicSpecialFunction.php index 602c7eec..eed8fbee 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 e1cb69fe..6002caa4 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 d0f06e6a..577d3a83 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 b03bd452..fb259b95 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 -- GitLab