Improving the Bootstrap class call.

This commit is contained in:
Ilya Bakhlin 2022-01-01 19:40:36 +01:00
parent 1eb259a295
commit 24e48868d8
2 changed files with 4 additions and 11 deletions

View file

@ -70,21 +70,14 @@ class Bootstrap
} }
/** /**
* Starts framework.
*
* @return void * @return void
* @internal
*/ */
function ignite(bool $headless = false): void function ignite(): void
{ {
$this->registerFunctions(); $this->registerFunctions();
$this->registerDebugger(); $this->registerDebugger();
$this->igniteExtensions(); $this->igniteExtensions();
if (!$headless) { header("Referrer-Policy: strict-origin-when-cross-origin");
header("Referrer-Policy: strict-origin-when-cross-origin"); $this->route(function_exists("get_current_url") ? get_current_url() : $_SERVER["REQUEST_URI"]);
$this->route(function_exists("get_current_url") ? get_current_url() : $_SERVER["REQUEST_URI"]);
}
} }
} }
return new Bootstrap;

View file

@ -7,6 +7,6 @@ require_once(dirname(__DIR__) . "/vendor/autoload.php");
define("CHANDLER_ROOT", dirname(__DIR__)); define("CHANDLER_ROOT", dirname(__DIR__));
define("CHANDLER_ROOT_CONF", yaml_parse_file(CHANDLER_ROOT . "/chandler.yml")); define("CHANDLER_ROOT_CONF", yaml_parse_file(CHANDLER_ROOT . "/chandler.yml"));
$bootstrap = require("../chandler/Bootstrap.php"); $bootstrap = new Bootstrap();
$bootstrap->ignite(); $bootstrap->ignite();