<?php

declare(strict_types=1);

require_once __DIR__ . '/constants.php';

require_once AUTOLOAD_PATH . '/Autoloader.php';

use System\Autoload\Autoloader;

$loader = new Autoloader();

$loader->addNamespace('App\\', APP_PATH);
$loader->addNamespace('System\\', SYSTEM_PATH);

$loader->register();

/*
|--------------------------------------------------------------------------
| Helper Functions
|--------------------------------------------------------------------------
*/

require_once SYSTEM_PATH . '/Support/helpers.php';

/*
|--------------------------------------------------------------------------
| Environment
|--------------------------------------------------------------------------
*/

use System\Environment\Environment;

Environment::load(BASE_PATH . '/.env');
use System\Configuration\Config;

Config::load(CONFIG_PATH);
use System\Application\Application;

$app = new Application();

return $app;