From e59bfc26a044f6f6917f1128143e0eebac787964 Mon Sep 17 00:00:00 2001 From: igor Date: Mon, 9 Feb 2026 07:48:07 +0100 Subject: [PATCH] generovane subory apilite, fix globalnych $_SERVER v konfiguracii --- backend/composer.json | 3 ++- backend/composer.lock | 11 +++++++---- backend/config/Configuration.php | 4 ++-- backend/public/API.php | 4 ++++ backend/scripts/buildTypeScript.php | 19 +++++++++++++++++++ backend/src/API.php | 11 +++++++++++ backend/src/Init.php | 1 - backend/src/Maintenance.php | 2 +- 8 files changed, 46 insertions(+), 9 deletions(-) create mode 100644 backend/public/API.php create mode 100644 backend/scripts/buildTypeScript.php create mode 100644 backend/src/API.php diff --git a/backend/composer.json b/backend/composer.json index a9c51dc..a39c287 100644 --- a/backend/composer.json +++ b/backend/composer.json @@ -22,6 +22,7 @@ "tpsoft/dbmodel": "^1.1" }, "scripts": { - "model": "php scripts/createModel.php" + "model": "php scripts/createModel.php", + "build": "php scripts/buildTypeScript.php" } } \ No newline at end of file diff --git a/backend/composer.lock b/backend/composer.lock index 3a0878b..e028210 100644 --- a/backend/composer.lock +++ b/backend/composer.lock @@ -4,19 +4,22 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "9b92dc81ccf6b0cc7f350c56793c6523", + "content-hash": "a71cf25cd9eac873c72969207706f3c8", "packages": [ { "name": "tpsoft/apilite", - "version": "v1.0.3", + "version": "v1.1.0", "source": { "type": "git", "url": "https://gitea.tpsoft.org/TPsoft.org/APIlite.git", - "reference": "c0fd7b3fe5270ee44a84a92e9255ada2438812b7" + "reference": "fab8efd780ede046ced076f237351cdba5a8a51f" }, "require": { "php": ">=8.2" }, + "bin": [ + "bin/apilite-files" + ], "type": "library", "autoload": { "psr-4": { @@ -49,7 +52,7 @@ "type": "other" } ], - "time": "2025-10-13T21:36:34+00:00" + "time": "2026-02-09T06:33:17+00:00" }, { "name": "tpsoft/dbmodel", diff --git a/backend/config/Configuration.php b/backend/config/Configuration.php index b0e58f4..d7e3dac 100644 --- a/backend/config/Configuration.php +++ b/backend/config/Configuration.php @@ -25,7 +25,7 @@ if (!$loaded) { } $protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https://" : "http://"; -$host = $_SERVER['HTTP_HOST']; -$uri = $_SERVER['REQUEST_URI']; // obsahuje aj query string +$host = $_SERVER['HTTP_HOST'] ?? 'localhost'; +$uri = $_SERVER['REQUEST_URI'] ?? ''; // obsahuje aj query string define('URL_PREFIX', $protocol.$host.str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME'])); diff --git a/backend/public/API.php b/backend/public/API.php new file mode 100644 index 0000000..1a46c81 --- /dev/null +++ b/backend/public/API.php @@ -0,0 +1,4 @@ +