From c55b4fd7a6261425bc3da206c4997129952c301f Mon Sep 17 00:00:00 2001 From: Stein Magne Bjorklund <steinmb@smbjorklund.com> Date: Mon, 20 Sep 2021 20:42:44 +0200 Subject: [PATCH] Importer class use Configuration class - Reformatting - Error 500 exits. Will never return. --- classes/Importer.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/classes/Importer.php b/classes/Importer.php index e8b162ec..dae575b2 100644 --- a/classes/Importer.php +++ b/classes/Importer.php @@ -28,10 +28,12 @@ final class Importer { set_time_limit(0); error_reporting(E_ERROR); + if (is_file(FILE)) { echo "There is an existing " . FILE . " file on this installation. Please remove it before importing a new one"; exit(0); } + if (!isset($_GET['import']) && !isset($_POST['importtext'])) { $this->showInterface(); exit(0); @@ -52,11 +54,11 @@ final class Importer $parser->parse(RDF, $_POST['importtext']); } else { HTTPStatus::send500(); - exit(0); } $triples = $parser->getTriples(); $appArr = $this->search($triples, null, RDF . 'type', LS . 'Application'); + if (!(sizeof($appArr) > 0)) { echo "I can't find an application from the URL given"; exit(0); @@ -186,8 +188,7 @@ final class Importer private function createNamespaces($ns) { - require_once LOADSPEAKR_ROOT . '/namespaces.php'; - global $conf; + $conf = $this->configuration->getConfigValue('conf', ''); $namespaces = ""; try { -- GitLab