From fe3a0ac9935e533701666dc1e07c50036548a537 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Mon, 28 May 2018 23:16:14 +0200 Subject: [PATCH] Update skeleton for site/app refactoring --- flarum | 17 ++++++++++++----- public/index.php | 17 ++++++++++++----- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/flarum b/flarum index ae12c33..0b2372e 100644 --- a/flarum +++ b/flarum @@ -13,8 +13,15 @@ define('FLARUM_START', microtime(true)); require 'vendor/autoload.php'; -Flarum\Console\Server::fromSite( - (new Flarum\Foundation\Site) - ->setBasePath(__DIR__) - ->setPublicPath(__DIR__) -)->listen(); +$site = Flarum\Foundation\Site::fromPaths([ + 'base' => __DIR__, + 'public' => __DIR__.'/public', +]); + +$app = $site->bootApp(); + +$server = new Flarum\Console\Server( + $app->getConsoleCommands() +); + +$server->listen(); diff --git a/public/index.php b/public/index.php index b2faef9..802e9ec 100644 --- a/public/index.php +++ b/public/index.php @@ -11,8 +11,15 @@ require '../vendor/autoload.php'; -Flarum\Http\Server::fromSite( - (new Flarum\Foundation\Site) - ->setBasePath(__DIR__.'/..') - ->setPublicPath(__DIR__) -)->listen(); +$site = Flarum\Foundation\Site::fromPaths([ + 'base' => __DIR__.'/..', + 'public' => __DIR__, +]); + +$app = $site->bootApp(); + +$server = new Flarum\Http\Server( + $app->getRequestHandler() +); + +$server->listen();