From e28ea70f92a4cf7faaee3e30a12e2b2dac30ab5c Mon Sep 17 00:00:00 2001
From: alangrafu <alvaro@graves.cl>
Date: Sat, 17 Dec 2011 00:58:41 -0800
Subject: [PATCH] Fixed bug with lack of reference to parent app

---
 classes/Exporter.php | 6 +++++-
 classes/Importer.php | 2 +-
 index.php            | 2 +-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/classes/Exporter.php b/classes/Exporter.php
index 3bdc70be..fb70f55c 100644
--- a/classes/Exporter.php
+++ b/classes/Exporter.php
@@ -31,7 +31,11 @@ class Exporter{
   	array_push($triples, $t);
   	$t['o']      = LS.'Application';	
   	array_push($triples, $t);
-  	
+  	if($conf['parentApp'] != NULL){
+  	 	$t['p'] = OPMV.'wasDerivedFrom';
+  	 	$t['o'] = $conf['parentApp'];
+  	 	array_push($triples, $t);
+  	}
   	
   	$t['p']      = LS.'usedParameter';
   	$t['o']      = uniqid("_:b");
diff --git a/classes/Importer.php b/classes/Importer.php
index 3fddb06d..a06175f7 100644
--- a/classes/Importer.php
+++ b/classes/Importer.php
@@ -58,7 +58,7 @@ class Importer{
 	//$arr = explode("lodspeakr/benegesserit", $this->basedir);
 	//$this->basedir = $arr[0];
 	$content .= "\$conf['basedir'] = \"$this->basedir\";\n";
-	
+	$content .= "\$conf['parentApp'] = \"$app\";\n";
 	$pwd = getcwd();
 	$content .= "\$conf['home'] = \"$pwd/\";\n";
 	
diff --git a/index.php b/index.php
index 0a0b415c..9777501e 100755
--- a/index.php
+++ b/index.php
@@ -41,7 +41,7 @@ $extension = Utils::getExtension($acceptContentType);
 if($acceptContentType == NULL){
   Utils::send406($uri);
 }
-if(file_exists($conf['static']['directory'].$_GET['q']) && sizeof($_GET['q'])>0){
+if(sizeof($_GET['q'])>0 && file_exists($conf['static']['directory'].$_GET['q'])){
   echo file_get_contents($conf['static']['directory'].$_GET['q']);
   exit(0);
 }
-- 
GitLab