Fix Warnings
This commit is contained in:
parent
4a9d236698
commit
5a1cfd1128
32
index.php
32
index.php
|
@ -10,22 +10,6 @@
|
|||
|
||||
<?php
|
||||
|
||||
// Debug
|
||||
//var_dump($_SERVER);
|
||||
// Debug
|
||||
|
||||
$not_found_error = '<h1>File not found, error 404</h1>';
|
||||
|
||||
$basedir = 'content';
|
||||
$request_uri = $_SERVER['REQUEST_URI'];
|
||||
|
||||
$path = $basedir . $request_uri;
|
||||
$files_in_folder = scandir($path);
|
||||
|
||||
// Debug
|
||||
//var_dump($files_in_folder);
|
||||
// Debug
|
||||
|
||||
function link_from_file(string $filename, string $name = null, string $css_class = null ) : string {
|
||||
// Check if css_class is null
|
||||
$css_class = $css_class ? "class=\"$css_class\"" : '';
|
||||
|
@ -49,11 +33,27 @@ function filter_files_dir($files_array, string $path) : array {
|
|||
return $ret_array;
|
||||
}
|
||||
|
||||
// Debug
|
||||
//var_dump($_SERVER);
|
||||
// Debug
|
||||
|
||||
// Debug
|
||||
//var_dump($files_in_folder);
|
||||
// Debug
|
||||
|
||||
$not_found_error = '<h1>File not found, error 404</h1>';
|
||||
|
||||
if(!$files_in_folder) {
|
||||
echo($not_found_error);
|
||||
die();
|
||||
}
|
||||
|
||||
$basedir = 'content';
|
||||
$request_uri = $_SERVER['REQUEST_URI'];
|
||||
|
||||
$path = $basedir . $request_uri;
|
||||
$files_in_folder = scandir($path);
|
||||
|
||||
$resource_array = filter_files_dir($files_in_folder, $path);
|
||||
|
||||
// Show folder links
|
||||
|
|
Loading…
Reference in New Issue