summaryrefslogtreecommitdiff
path: root/src/http/Http.php
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2024-01-02 20:42:01 +0100
committerDaniel Weipert <git@mail.dweipert.de>2024-01-05 12:33:59 +0100
commitb21316248572cb27ed1f504529ad6680a473022e (patch)
treef8a2f81258cae3b1d2429fb7df5a3287954b683a /src/http/Http.php
parentf621d95f89ded05a2e916c5ee363bfe75ea37482 (diff)
gemini
Diffstat (limited to 'src/http/Http.php')
-rw-r--r--src/http/Http.php37
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();
+ }
+}