mapguesser/main.php
Pőcze Bence 624b2f8b31
All checks were successful
mapguesser/pipeline/pr-develop This commit looks good
use IRouteCollection in app container
2023-04-20 00:30:01 +02:00

26 lines
870 B
PHP

<?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;
static SokoWeb\Interfaces\PersistentData\IPersistentDataManager $persistentDataManager;
static SokoWeb\Interfaces\Routing\IRouteCollection $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']);
Container::$persistentDataManager = new SokoWeb\PersistentData\PersistentDataManager(Container::$dbConnection);