v2.0-alpha

This commit is contained in:
2022-06-20 19:52:31 +02:00
parent b549af3166
commit ce647d4423
78 changed files with 2474 additions and 2083 deletions

View File

@@ -10,7 +10,7 @@ if (is_file($autoLoad)) {
require_once $autoLoad;
}
define("WEBBASE_VERSION", "1.5.2");
define("WEBBASE_VERSION", "2.0.0-alpha");
spl_autoload_extensions(".php");
spl_autoload_register(function ($class) {
@@ -28,10 +28,6 @@ spl_autoload_register(function ($class) {
}
});
function is_cli(): bool {
return php_sapi_name() === "cli";
}
function getProtocol(): string {
$isSecure = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ||
(!empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') ||
@@ -246,7 +242,7 @@ function getClassName($class, bool $short = true): string {
}
function createError($msg) {
return json_encode(array("success" => false, "msg" => $msg));
return ["success" => false, "msg" => $msg];
}
function downloadFile($handle, $offset = 0, $length = null): bool {
@@ -278,3 +274,8 @@ function parseClass($class): string {
$parts = array_map('ucfirst', $parts);
return implode("\\", $parts);
}
function isClass(string $str): bool {
$path = getClassPath($str);
return is_file($path) && class_exists($str);
}