soko-web/templates/app.php.tpl

26 lines
809 B
Smarty
Raw Normal View History

2023-04-07 19:32:15 +02:00
<?php
define('SCRIPT_STARTED', hrtime(true));
require 'vendor/autoload.php';
const ROOT = __DIR__;
const VERSION = '';
const REVISION = '';
const REVISION_DATE = '';
$dotenv = Dotenv\Dotenv::createImmutable(ROOT);
$dotenv->load();
class Container
{
static SokoWeb\Interfaces\Database\IConnection $dbConnection;
2023-04-17 01:55:37 +02:00
static SokoWeb\Database\AuditLoggerBase $auditLogger;
2023-04-07 19:32:15 +02:00
static SokoWeb\Routing\RouteCollection $routeCollection;
static SokoWeb\Interfaces\Session\ISessionHandler $sessionHandler;
static SokoWeb\Interfaces\Request\IRequest $request;
}
Container::$dbConnection = new SokoWeb\Database\Mysql\Connection($_ENV['DB_HOST'], $_ENV['DB_USER'], $_ENV['DB_PASSWORD'], $_ENV['DB_NAME']);
2023-04-17 01:55:37 +02:00
Container::$auditLogger = new {app}\Database\AuditLogger(Container::$dbConnection, 'audit_log');