This commit is contained in:
Turtle committed 2026-01-11 10:26:39 +01:00
1 parent 565c1b9911
commit 28490ce8b3
36 files changed
+587 -179

No files matched your search

+30
View File
@@ -0,0 +1,30 @@
<?php
function isFileExtImage(string $fileExt) :bool {
switch ($fileExt) {
case 'png':
case 'jpg':
case 'jpeg':
case 'ico':
case 'gif':
return true;
default:
return false;
}
}
function res_mixed(bool $success, mixed $data = null, string $except = null) :object {
return $success ? res_ok($data): res_err($data ?? $except);
}
function res_ok(mixed $data = null) :object {
return (object) [
"type" => "success",
"data" => $data
];
}
function res_err(string|null $message = null) :object {
return (object) [
"type" => "error",
"message" => $message
];
}