Make config instantiation private

Fixup Paths
Moved all tests to phpunit tests

Signed-off-by: Diederik de Groot <ddegroot@talon.nl>
This commit is contained in:
Diederik de Groot
2020-03-18 11:57:30 +01:00
parent c535113c55
commit 3e9f731e9a
5 changed files with 87 additions and 83 deletions

View File

@@ -1,6 +1,6 @@
<?php
include_once("../lib/config.php");
include_once("../lib/resolve.php");
include_once("../../lib/config.php");
include_once("../../lib/resolve.php");
$request = $_REQUEST ?? null;
function send_fallback_html($message) {
@@ -50,8 +50,10 @@ if (!$request || empty($request) || !array_key_exists('filename',$request) || em
exit();
}
try {
global $base_path;
$req_filename=$request['filename'];
$resolve = new Resolver($config);
$configParser = new SCCP\Config\ConfigParser($base_path, "config.ini");
$resolve = new SCCP\Resolve\Resolve($configParser->getConfiguration());
if (($filename = $resolve->resolve($req_filename))) {
sendfile($filename);
}