mirror of
https://github.com/openvk/chandler.git
synced 2025-03-29 12:38:12 +03:00
Removing the Bootstrap class.
This commit is contained in:
parent
26a47de1a9
commit
104416c967
2 changed files with 11 additions and 26 deletions
|
@ -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();
|
||||
}
|
||||
}
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
declare(strict_types = 1);
|
||||
|
||||
use Chandler\MVC\Routing\Router;
|
||||
|
||||
require_once(dirname(__DIR__) . "/vendor/autoload.php");
|
||||
|
||||
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_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();
|
||||
|
|
Loading…
Reference in a new issue