diff options
author | Daniel Weipert <code@drogueronin.de> | 2023-09-24 13:40:25 +0200 |
---|---|---|
committer | Daniel Weipert <code@drogueronin.de> | 2023-09-24 13:40:25 +0200 |
commit | fa00b957378a393f8edbfc98ef111d35d18ecb09 (patch) | |
tree | 654e7dc5414f7f2795dbe996d3e1570793a5b1b8 /src/App.php |
initial commit
Diffstat (limited to 'src/App.php')
-rw-r--r-- | src/App.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/App.php b/src/App.php new file mode 100644 index 0000000..f1fa97e --- /dev/null +++ b/src/App.php @@ -0,0 +1,32 @@ +<?php + +namespace App; + +use Symfony\Component\HttpFoundation\Request; + +class App +{ + public function __construct() { + if ($_ENV['APP_ENV'] === 'development') { + error_reporting(E_ALL); + } + + // DB + DB::init(); + + // Router + Router::init(Request::createFromGlobals()); + + // View + View::init(); + + // Events + new EventRunner(); + } + + public function run(): void + { + $response = Router::execute(); + $response->send(); + } +} |