This commit is contained in:
2021-04-06 16:34:12 +02:00
parent dac3dc2331
commit a51b427c2e
3 changed files with 104 additions and 10 deletions

View File

@@ -2,6 +2,17 @@
define("WEBBASE_VERSION", "1.2.3");
spl_autoload_extensions(".php");
spl_autoload_register(function($class) {
$full_path = getClassPath($class);
if(file_exists($full_path)) {
include_once $full_path;
} else {
include_once getClassPath($class, false);
}
});
function getProtocol(): string {
return (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https" : "http";
}