generovane subory apilite,
fix globalnych $_SERVER v konfiguracii
This commit is contained in:
@ -22,6 +22,7 @@
|
||||
"tpsoft/dbmodel": "^1.1"
|
||||
},
|
||||
"scripts": {
|
||||
"model": "php scripts/createModel.php"
|
||||
"model": "php scripts/createModel.php",
|
||||
"build": "php scripts/buildTypeScript.php"
|
||||
}
|
||||
}
|
||||
11
backend/composer.lock
generated
11
backend/composer.lock
generated
@ -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",
|
||||
|
||||
@ -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']));
|
||||
|
||||
4
backend/public/API.php
Normal file
4
backend/public/API.php
Normal file
@ -0,0 +1,4 @@
|
||||
<?php
|
||||
|
||||
require_once __DIR__.'/../src/API.php';
|
||||
new \TPsoft\Nutrio\API();
|
||||
19
backend/scripts/buildTypeScript.php
Normal file
19
backend/scripts/buildTypeScript.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
ob_start();
|
||||
|
||||
$backend_api = new TPsoft\BugreportBackend\API('typescript', 'import.meta.env.VITE_BACKENDAPI_URL', 'backend');
|
||||
|
||||
$output = ob_get_contents();
|
||||
ob_end_clean();
|
||||
|
||||
$ts_path = realpath(__DIR__ . '/../../frontend/src').'/backend.js';
|
||||
$suc = file_put_contents($ts_path, $output);
|
||||
if ($suc === false) {
|
||||
echo "✗ TypeScript store into file failed\n";
|
||||
exit(2);
|
||||
}
|
||||
|
||||
echo "✓ TypeScript backend script created\n";
|
||||
11
backend/src/API.php
Normal file
11
backend/src/API.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace TPsoft\Nutrio;
|
||||
|
||||
require_once __DIR__.'/Init.php';
|
||||
|
||||
use TPsoft\APIlite\APIlite;
|
||||
|
||||
class API extends APIlite {
|
||||
|
||||
}
|
||||
@ -2,7 +2,6 @@
|
||||
|
||||
require __DIR__ . '/../vendor/autoload.php';
|
||||
|
||||
use \Exception;
|
||||
use \TPsoft\DBmodel\DBmodel;
|
||||
use \TPsoft\Nutrio\Maintenance;
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace TPsoft\Nutrio\;
|
||||
namespace TPsoft\Nutrio;
|
||||
|
||||
class Maintenance extends \TPsoft\DBmodel\Maintenance
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user