diff options
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(); + } +} |