diff options
Diffstat (limited to 'src/http/Http.php')
-rw-r--r-- | src/http/Http.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/http/Http.php b/src/http/Http.php new file mode 100644 index 0000000..1867eb4 --- /dev/null +++ b/src/http/Http.php @@ -0,0 +1,37 @@ +<?php + +namespace App\http; + +use App\DB; +use App\EventRunner; +use App\http\Router; +use App\View; +use Symfony\Component\HttpFoundation\Request; + +class Http +{ + public function __construct() + { + // Session + session_start(); + + // DB + DB::init(); + + // Router + Router::init(Request::createFromGlobals()); + + // View + View::init(); + View::addGlobal('session', $_SESSION); + + // Events + new EventRunner(); + } + + public function run(): void + { + $response = Router::execute(); + $response->send(); + } +} |