Merge pull request #55 from flarum/fl/sites

Update skeleton for site/app refactoring
pull/56/head
Toby Zerner 2018-08-24 18:21:34 +09:30 committed by GitHub
commit 7b5bd17c77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 24 additions and 10 deletions

17
flarum
View File

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

View File

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