Removing the Bootstrap class.

This commit is contained in:
Ilya Bakhlin 2022-01-09 00:37:58 +01:00
parent 26a47de1a9
commit 104416c967
2 changed files with 11 additions and 26 deletions

View file

@ -1,24 +0,0 @@
<?php
declare(strict_types = 1);
use Chandler\MVC\Routing\Router;
class Bootstrap
{
/**
* @return void
*/
public function ignite(): void
{
Chandler\Extensions\ExtensionManager::getInstance();
ob_start();
if (($output = Router::getInstance()->execute($_SERVER["REQUEST_URI"])) !== null)
echo $output;
else
chandler_http_panic(404, "Not Found", "No routes for {$_SERVER["REQUEST_URI"]}.");
ob_flush();
ob_end_flush();
flush();
}
}

View file

@ -2,6 +2,8 @@
declare(strict_types = 1); declare(strict_types = 1);
use Chandler\MVC\Routing\Router;
require_once(dirname(__DIR__) . "/vendor/autoload.php"); require_once(dirname(__DIR__) . "/vendor/autoload.php");
define("CHANDLER_ROOT", dirname(__DIR__)); define("CHANDLER_ROOT", dirname(__DIR__));
@ -9,6 +11,13 @@ define("CHANDLER_ROOT_CONF", yaml_parse_file(CHANDLER_ROOT . "/chandler.yml"));
define("CHANDLER_EXTENSIONS_AVAILABLE", CHANDLER_ROOT . CHANDLER_ROOT_CONF["extensions"]["available"]); define("CHANDLER_EXTENSIONS_AVAILABLE", CHANDLER_ROOT . CHANDLER_ROOT_CONF["extensions"]["available"]);
define("CHANDLER_EXTENSIONS_ENABLED", CHANDLER_ROOT . CHANDLER_ROOT_CONF["extensions"]["enabled"]); define("CHANDLER_EXTENSIONS_ENABLED", CHANDLER_ROOT . CHANDLER_ROOT_CONF["extensions"]["enabled"]);
$bootstrap = new Bootstrap(); Chandler\Extensions\ExtensionManager::getInstance();
$bootstrap->ignite(); ob_start();
if (($output = Router::getInstance()->execute($_SERVER["REQUEST_URI"])) !== null)
echo $output;
else
chandler_http_panic(404, "Not Found", "No routes for {$_SERVER["REQUEST_URI"]}.");
ob_flush();
ob_end_flush();
flush();