Skip to content
Snippets Groups Projects
Commit b72ca8ca authored by Stein Magne Bjorklund's avatar Stein Magne Bjorklund
Browse files

Importer class, getting rid of warnings

parent c55b4fd7
No related branches found
No related tags found
1 merge request!18Resolve "Remove all use of GLOBALS"
......@@ -53,7 +53,7 @@ final class Importer
} elseif (isset($_POST['importtext'])) {
$parser->parse(RDF, $_POST['importtext']);
} else {
HTTPStatus::send500();
HTTPStatus::send500('');
}
$triples = $parser->getTriples();
......@@ -154,7 +154,7 @@ final class Importer
$content .= "?>\n";
try {
$fh = fopen(FILE, 'a');
$fh = fopen(FILE, 'ab');
fwrite($fh, $content);
fclose($fh);
} catch (Exception $e) {
......@@ -235,7 +235,7 @@ final class Importer
chdir($path[$i]);
}
$fh = fopen(end($path), 'w');
$fh = fopen(end($path), 'wb');
fwrite($fh, $v);
fclose($fh);
......@@ -273,7 +273,7 @@ final class Importer
chdir($path[$i]);
}
$fh = fopen(end($path), 'w');
$fh = fopen(end($path), 'wb');
fwrite($fh, $v);
fclose($fh);
......@@ -311,7 +311,7 @@ final class Importer
chdir($path[$i]);
}
$fh = fopen(end($path), 'w');
$fh = fopen(end($path), 'wb');
fwrite($fh, $v);
fclose($fh);
......@@ -376,7 +376,7 @@ final class Importer
private function showInterface(): void
{
echo <<<HTML
<html>
<html lang="eng">
<head>
<title>Importing options</title>
</head>
......@@ -385,7 +385,7 @@ final class Importer
You can paste the data obtained from another LODSPeaKr instance here in the box.
You can also automatize this import by adding a parameter '?import=URL' to this page.
Usually, the URL will be of the for <pre>https://example.com/export</pre>
<form action='import' method='post'>
<form action='" . $this->basedir . "/import' method='post'>
<textarea cols='100' rows='25' name='importtext'></textarea>
<input type='submit' value='Import'/>
</form>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment