Move public files to /public subdirectory
phpcs-errors:221 phpunit-status:successful phpstan-errors:0
This commit is contained in:
1 parent
00f1c4f423
commit
d56601b0cc
19 files changed
+60
-28
No files matched your search
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -5,7 +5,7 @@
|
|||||||
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||||
*/
|
*/
|
||||||
declare(strict_types = 1);
|
declare(strict_types = 1);
|
||||||
require_once __DIR__ . "/functions/functions.php";
|
require_once __DIR__ . "/../functions/functions.php";
|
||||||
|
|
||||||
if (session_status() != PHP_SESSION_ACTIVE) {
|
if (session_status() != PHP_SESSION_ACTIVE) {
|
||||||
session_start();
|
session_start();
|
||||||
@@ -31,7 +31,7 @@
|
|||||||
}
|
}
|
||||||
else $selectionActive = false;
|
else $selectionActive = false;
|
||||||
|
|
||||||
require __DIR__ . "/values/availableFields.php";
|
require __DIR__ . "/../values/availableFields.php";
|
||||||
|
|
||||||
$line1 = $line2 = $line3 = $line4 = [];
|
$line1 = $line2 = $line3 = $line4 = [];
|
||||||
|
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||||
*/
|
*/
|
||||||
declare(strict_types = 1);
|
declare(strict_types = 1);
|
||||||
require_once __DIR__ . "/functions/functions.php";
|
require_once __DIR__ . "/../functions/functions.php";
|
||||||
|
|
||||||
if (session_status() != PHP_SESSION_ACTIVE) {
|
if (session_status() != PHP_SESSION_ACTIVE) {
|
||||||
session_start();
|
session_start();
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
</div>
|
</div>
|
||||||
';
|
';
|
||||||
|
|
||||||
require __DIR__ . "/values/availableFields.php";
|
require __DIR__ . "/../values/availableFields.php";
|
||||||
|
|
||||||
$tooltips = [];
|
$tooltips = [];
|
||||||
foreach ($availableFields as $headline => $fields) {
|
foreach ($availableFields as $headline => $fields) {
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
declare(strict_types = 1);
|
declare(strict_types = 1);
|
||||||
require_once __DIR__ . "/functions/functions.php";
|
require_once __DIR__ . "/../functions/functions.php";
|
||||||
|
|
||||||
if (session_status() != PHP_SESSION_ACTIVE) {
|
if (session_status() != PHP_SESSION_ACTIVE) {
|
||||||
session_start();
|
session_start();
|
||||||
@@ -21,11 +21,11 @@
|
|||||||
$lang = $_SESSION['lang'];
|
$lang = $_SESSION['lang'];
|
||||||
|
|
||||||
$filename = $_GET['fnam'];
|
$filename = $_GET['fnam'];
|
||||||
$csv_datei = 'csv/' . $filename;
|
$csv_datei = MD_STD::realpath(__DIR__ . '/../csv/' . $filename);
|
||||||
|
|
||||||
// Get allowed values * $fieldNoMultiplicator
|
// Get allowed values * $fieldNoMultiplicator
|
||||||
$fieldNoMultiplicator = 10;
|
$fieldNoMultiplicator = 10;
|
||||||
require __DIR__ . "/values/availableFields.php";
|
require __DIR__ . "/../values/availableFields.php";
|
||||||
|
|
||||||
$allowed = $eventpart = $eventpartsure = $fieldsWithDependency = $fieldsWithAllowedValueSet = [];
|
$allowed = $eventpart = $eventpartsure = $fieldsWithDependency = $fieldsWithAllowedValueSet = [];
|
||||||
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
declare(strict_types = 1);
|
declare(strict_types = 1);
|
||||||
require_once __DIR__ . "/functions/functions.php";
|
require_once __DIR__ . "/../functions/functions.php";
|
||||||
|
|
||||||
if (session_status() != PHP_SESSION_ACTIVE) {
|
if (session_status() != PHP_SESSION_ACTIVE) {
|
||||||
session_start();
|
session_start();
|
||||||
@@ -24,14 +24,10 @@
|
|||||||
echo "Error: Invalid file name";
|
echo "Error: Invalid file name";
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
$csv_datei = __DIR__ . '/csv/' . $filename;
|
$csv_datei = MD_STD::realpath(__DIR__ . '/../csv/' . $filename);
|
||||||
if (!file_exists($csv_datei)) {
|
|
||||||
echo "Error: The CSV file does not exist.";
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (is_dir(__DIR__ . "/xml")) rrmdir(__DIR__ . '/xml');
|
if (is_dir(__DIR__ . "/../xml")) rrmdir(__DIR__ . '/../xml');
|
||||||
mkdir(__DIR__ . "/xml", 0755);
|
mkdir(__DIR__ . "/../xml", 0755);
|
||||||
|
|
||||||
if (!($fp = fopen($csv_datei, 'r'))) {
|
if (!($fp = fopen($csv_datei, 'r'))) {
|
||||||
throw new MDmainEntityNotExistentException("Failed opening file");
|
throw new MDmainEntityNotExistentException("Failed opening file");
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
declare(strict_types = 1);
|
declare(strict_types = 1);
|
||||||
require_once __DIR__ . "/functions/functions.php";
|
require_once __DIR__ . "/../functions/functions.php";
|
||||||
|
|
||||||
$target = "csv/" . basename($_FILES['uploaded']['name']);
|
$target = __DIR__ . "/../csv/" . basename($_FILES['uploaded']['name']);
|
||||||
$targetpart = basename($_FILES['uploaded']['name']);
|
$targetpart = basename($_FILES['uploaded']['name']);
|
||||||
|
|
||||||
if (session_status() != PHP_SESSION_ACTIVE) {
|
if (session_status() != PHP_SESSION_ACTIVE) {
|
||||||
@@ -1,10 +1,9 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
require_once "inc/zip.php";
|
require_once __DIR__ . "/../inc/zip.php";
|
||||||
|
require_once __DIR__ . "/../functions/functions.php";
|
||||||
require_once __DIR__ . "/functions/functions.php";
|
|
||||||
|
|
||||||
$fileTime = date("D, d M Y H:i:s T");
|
$fileTime = date("D, d M Y H:i:s T");
|
||||||
$fileDir = 'xml/';
|
$fileDir = __DIR__ . '/../xml/';
|
||||||
|
|
||||||
$zip = new Zip();
|
$zip = new Zip();
|
||||||
//$zip->setComment("Example Zip file.\nCreated on " . date('l jS \of F Y h:i:s A'));
|
//$zip->setComment("Example Zip file.\nCreated on " . date('l jS \of F Y h:i:s A'));
|
||||||
@@ -40,5 +39,5 @@
|
|||||||
header("Content-Length: " . $length);
|
header("Content-Length: " . $length);
|
||||||
echo $zipData;
|
echo $zipData;
|
||||||
|
|
||||||
rrmdir(__DIR__ . '/xml');
|
rrmdir(__DIR__ . '/../xml');
|
||||||
|
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
<?PHP
|
||||||
|
/**
|
||||||
|
* This script contains tests for the home page.
|
||||||
|
*
|
||||||
|
* @author Joshua Ramon Enslin <joshua@jrenslin.de>
|
||||||
|
*/
|
||||||
|
declare(strict_types = 1);
|
||||||
|
|
||||||
|
// phpcs:disable
|
||||||
|
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test class for the start page.
|
||||||
|
*/
|
||||||
|
final class CsvTest extends TestCase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test for HTML output.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function testHTMLOutput():void {
|
||||||
|
|
||||||
|
include __DIR__ . "/../public/csv.php";
|
||||||
|
$output = $this->getActualOutput();
|
||||||
|
|
||||||
|
self::assertIsString($output);
|
||||||
|
ob_clean();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+10
-6
@@ -10,18 +10,22 @@
|
|||||||
|
|
||||||
use PHPUnit\Framework\TestCase;
|
use PHPUnit\Framework\TestCase;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test class for the start page.
|
||||||
|
*/
|
||||||
final class StartPageTest extends TestCase {
|
final class StartPageTest extends TestCase {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Test for HTML output.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
public function testHTMLOutput():void {
|
public function testHTMLOutput():void {
|
||||||
|
|
||||||
include __DIR__ . "/../index.php";
|
include __DIR__ . "/../public/index.php";
|
||||||
$output = $this->getActualOutput();
|
$output = $this->getActualOutput();
|
||||||
|
|
||||||
self::assertEquals(
|
self::assertIsString($output);
|
||||||
true,
|
|
||||||
is_string($output)
|
|
||||||
);
|
|
||||||
|
|
||||||
ob_clean();
|
ob_clean();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user