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();