summaryrefslogtreecommitdiff
path: root/src/App.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/App.php
parentf621d95f89ded05a2e916c5ee363bfe75ea37482 (diff)
gemini
Diffstat (limited to 'src/App.php')
-rw-r--r--src/App.php32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/App.php b/src/App.php
index 7524d38..9516a06 100644
--- a/src/App.php
+++ b/src/App.php
@@ -2,34 +2,32 @@
namespace App;
-use Symfony\Component\HttpFoundation\Request;
+use App\gemini\Gemini;
+use App\http\Http;
class App
{
+ private $appRunner;
+
public function __construct() {
if ($_ENV['APP_ENV'] === 'development') {
error_reporting(E_ALL);
}
- // Session
- session_start();
-
- // DB
- DB::init();
-
- // Router
- Router::init(Request::createFromGlobals());
-
- // View
- View::init();
-
- // Events
- new EventRunner();
+ if (isset($_ENV['GEMINI'])) {
+ $this->appRunner = new Gemini([
+ 'file' => dirname(__DIR__) . '/cert.pem',
+ 'key' => dirname(__DIR__) . '/key.rsa',
+ 'passphrase' => '',
+ ], $_ENV['APP_HOST']);
+ }
+ else {
+ $this->appRunner = new Http();
+ }
}
public function run(): void
{
- $response = Router::execute();
- $response->send();
+ $this->appRunner->run();
}
}