diff --git a/flarum b/flarum index 7a3f6db..476d7d0 100644 --- a/flarum +++ b/flarum @@ -8,14 +8,17 @@ * LICENSE file that was distributed with this source code. */ -require 'vendor/autoload.php'; +$site = require 'site.php'; -$server = new Flarum\Console\Server( - Flarum\Foundation\Site::fromPaths([ - 'base' => __DIR__, - 'public' => __DIR__.'/public', - 'storage' => __DIR__.'/storage', - ]) -); +/* +|------------------------------------------------------------------------------- +| Interpret console arguments +|------------------------------------------------------------------------------- +| +| Flarum's console interprets all command-line arguments to select and then +| execute corresponding commands for certain administrative tasks. +| +*/ +$server = new Flarum\Console\Server($site); $server->listen(); diff --git a/public/index.php b/public/index.php index 1f57f19..d1f12ed 100644 --- a/public/index.php +++ b/public/index.php @@ -7,14 +7,20 @@ * LICENSE file that was distributed with this source code. */ -require '../vendor/autoload.php'; +$site = require '../site.php'; -$server = new Flarum\Http\Server( - Flarum\Foundation\Site::fromPaths([ - 'base' => __DIR__.'/..', - 'public' => __DIR__.'/../public', - 'storage' => __DIR__.'/../storage', - ]) -); +/* +|------------------------------------------------------------------------------- +| Accept incoming HTTP requests +|------------------------------------------------------------------------------- +| +| Every HTTP request pointed to the web server that cannot be served by simply +| responding with one of the files in the "public" directory will be sent to +| this file. Now is the time to boot up Flarum's internal HTTP server, which +| will try its best to interpret the request and return the appropriate +| response, which could be a JSON document (for API responses) or a lot of HTML. +| +*/ +$server = new Flarum\Http\Server($site); $server->listen(); diff --git a/site.php b/site.php new file mode 100644 index 0000000..f532aa0 --- /dev/null +++ b/site.php @@ -0,0 +1,50 @@ + __DIR__, + 'public' => __DIR__.'/public', + 'storage' => __DIR__.'/storage', +]);