feat: automatic db creation and migration

This commit is contained in:
2026-08-28 16:32:25 +03:00
parent 114ba523f4
commit 4fbb8a8e2e
9 changed files with 104 additions and 120 deletions
+3 -3
View File
@@ -13,7 +13,7 @@ function db()
};
function relativePathToUrl($rel)
function relativePathToUrl(string $rel)
{
$parts = explode('/', dirname($_SERVER['SCRIPT_NAME']) . '/' . $rel);
$norm = [];
@@ -37,7 +37,7 @@ function FastDBReq(PDO $db, string $sql, array $params = []): array
}
}
function Login($req)
function Login(mixed $req)
{
return isset($req->data['pass']) && $req->data['pass'] == ADMIN_PASS;
}
@@ -46,7 +46,7 @@ CreateApi(function ($api) {
$api->on('/', 'GET', function ($req) {
return 'hi';
});
$api->on('/phpliteadmin', 'GET', function ($req) {
$api->on('/phpliteadmin', 'GET', function () {
header('Location: ./adm/phpliteadmin.php');
return "";
});