diff --git a/classes/Exporter.php b/classes/Exporter.php index 8dc07816b4d1977ab8e902ab905c3d491a99c0a0..0899a857966da2c849faeabfc00000f235876efd 100644 --- a/classes/Exporter.php +++ b/classes/Exporter.php @@ -382,7 +382,9 @@ class Exporter{ //break; } - + echo "#You can copy and paste the following data into a new\n"; + echo "#LODSPeaKr instance at http://exampleofinstance.org/benegesserit.php\n\n\n"; + echo "#As a side note: this is a turtle document but is served as text/plain to make it easier to copy&paste echo $ser->getSerializedTriples($triples); } diff --git a/classes/Utils.php b/classes/Utils.php index 9e9685edfd624f5826e8859fafd5af874949347d..321057c43ccf7f984f3dd8c5114ef3f0483bc52e 100644 --- a/classes/Utils.php +++ b/classes/Utils.php @@ -49,7 +49,11 @@ class Utils{ if(preg_match('|^//|', $parts[1])){ return $curie; } - return $ns[$parts[0]].$parts[1]; + if(sizeof($parts)>1 && isset($ns[$parts[0]])){ + return $ns[$parts[0]].$parts[1]; + }else{ + return $curie; + } } public static function getPrefix($curie){ diff --git a/index.php b/index.php index 962cd99ae261c92f2c34110d7f9b50770ce0f698..43b9204ee80409bf744bce477ad97ba16acf2354 100755 --- a/index.php +++ b/index.php @@ -1,4 +1,12 @@ <? + +if($_GET['q'] == 'import'){ + include_once('classes/Importer.php'); + $imp = new Importer(); + $imp->run(); + exit(0); +} + include_once('common.inc.php'); if($conf['debug']){ error_reporting(E_ALL); @@ -10,6 +18,7 @@ if(!file_exists('settings.inc.php')){ exit(0); } + include_once('classes/Utils.php'); include_once('classes/Queries.php'); include_once('classes/Endpoint.php'); @@ -32,7 +41,7 @@ if($_GET['q'] == 'export'){ include_once('settings.inc.php'); include_once('classes/Exporter.php'); $exp = new Exporter(); - header('Content-Type: text/turtle'); + header('Content-Type: text/plain'); $exp->run(); exit(0); } diff --git a/static/README.TXT b/static/README.TXT new file mode 100644 index 0000000000000000000000000000000000000000..7791f577c5080a33fffeed2c54b68699e97f10f4 --- /dev/null +++ b/static/README.TXT @@ -0,0 +1,3 @@ +This folder can be used to store static documents, such as HTML pages, CSS files and JS code. LODSPeaKr doesn't force you to use it, however, it is considered a good practice to have everything under static/ and not disperse everywhere. + +A second benefit is that it will allow other people to reuse your static pages if you decide to export the code. LODSPeaKr will only look on static/ models/ and views/ directories.