zmena implementacie suborov, ukladanie na filesystem a nie do DB

This commit is contained in:
2025-05-17 15:06:04 +02:00
parent d6be781024
commit c7dcdf228e
3 changed files with 109 additions and 19 deletions

View File

@ -7,6 +7,19 @@ if (file_exists('c:/php/includes/igor.php')) {
require_once __DIR__.'/lib/functions.inc.php';
require_once __DIR__.'/lib/Medoo/src/Medoo.php';
$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']));
define('UPLOAD_DIR_ATTACHMENTS', __DIR__.'/data/attachments/');
if (!file_exists(UPLOAD_DIR_ATTACHMENTS)) {
mkdir(UPLOAD_DIR_ATTACHMENTS, 0777, true);
}
define('UPLOAD_URL_ATTACHMENTS', URL_PREFIX.'data/attachments/');
global $db;
$db = new Medoo\Medoo([
'type' => 'sqlite',