inicializovany composer pre projekt,

instalovane balicky tpsoft/dbmodel a tpsoft/apilite.
vygenerovane subory dbmodel-files
This commit is contained in:
2026-02-09 06:51:07 +01:00
parent 36a1cb5704
commit d9a283cfdf
6 changed files with 258 additions and 0 deletions

View File

@ -0,0 +1,31 @@
<?php
$others_config = scandir(__DIR__);
$loaded = false;
foreach ($others_config as $file) {
if ($file == basename(__FILE__)) continue;
if (substr($file, -4) == '.php') {
require_once __DIR__ . '/' . $file;
$loaded = true;
}
}
if (!$loaded) {
class Configuration
{
public const DB_TYPE = 'sqlite';
// MySQL
public const DB_HOST = 'localhost';
public const DB_USER = 'username';
public const DB_PASS = '****************';
public const DB_NAME = 'databasename';
// SQLite
public const DB_FILEPATH = __DIR__ . '/../../data/database.db';
}
}
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? "https://" : "http://";
$host = $_SERVER['HTTP_HOST'];
$uri = $_SERVER['REQUEST_URI']; // obsahuje aj query string
define('URL_PREFIX', $protocol.$host.str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']));