diff --git a/artisan b/artisan index 1f46ff31a..0cf63cb67 100755 --- a/artisan +++ b/artisan @@ -1,51 +1,53 @@ #!/usr/bin/env php make(Illuminate\Contracts\Console\Kernel::class); + /* + |-------------------------------------------------------------------------- + | Run The Artisan Application + |-------------------------------------------------------------------------- + | + | When we run the console application, the current CLI command will be + | executed in this console and the response sent back to a terminal + | or another output device for the developers. Here goes nothing! + | + */ -$status = $kernel->handle( - $input = new Symfony\Component\Console\Input\ArgvInput, - new Symfony\Component\Console\Output\ConsoleOutput -); + $kernel = $app->make(Illuminate\Contracts\Console\Kernel::class); -/* -|-------------------------------------------------------------------------- -| Shutdown The Application -|-------------------------------------------------------------------------- -| -| Once Artisan has finished running, we will fire off the shutdown events -| so that any final work may be done by the application before we shut -| down the process. This is the last thing to happen to the request. -| -*/ + $status = $kernel->handle( + $input = new Symfony\Component\Console\Input\ArgvInput, + new Symfony\Component\Console\Output\ConsoleOutput + ); -$kernel->terminate($input, $status); + /* + |-------------------------------------------------------------------------- + | Shutdown The Application + |-------------------------------------------------------------------------- + | + | Once Artisan has finished running, we will fire off the shutdown events + | so that any final work may be done by the application before we shut + | down the process. This is the last thing to happen to the request. + | + */ -exit($status); + $kernel->terminate($input, $status); + + exit($status); diff --git a/bootstrap/autoload.php b/bootstrap/autoload.php index eec58a304..c8f53a99c 100644 --- a/bootstrap/autoload.php +++ b/bootstrap/autoload.php @@ -1,15 +1,17 @@ make(); + $repository = RepositoryBuilder::createWithDefaultAdapters()->make(); -$dotenv = Dotenv::create($repository, dirname(__DIR__, 1), null)->load(); + $dotenv = Dotenv::create($repository, dirname(__DIR__, 1), null)->load(); -$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap(); + /** @var Kernel $kernel */ + $kernel = app(Kernel::class); + $kernel->bootstrap(); diff --git a/public/index.php b/public/index.php index 8eb0733d7..58500ccd5 100644 --- a/public/index.php +++ b/public/index.php @@ -1,15 +1,55 @@ make(Illuminate\Contracts\Http\Kernel::class); + if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) { + require $maintenance; + } -$response = $kernel->handle($request = Illuminate\Http\Request::capture()); -$response->send(); -$kernel->terminate($request, $response); + /* + |-------------------------------------------------------------------------- + | Register The Auto Loader + |-------------------------------------------------------------------------- + | + | Composer provides a convenient, automatically generated class loader for + | this application. We just need to utilize it! We'll simply require it + | into the script here so we don't need to manually load our classes. + | + */ + + require __DIR__.'/../vendor/autoload.php'; + + /* + |-------------------------------------------------------------------------- + | Run The Application + |-------------------------------------------------------------------------- + | + | Once we have the application, we can handle the incoming request using + | the application's HTTP kernel. Then, we will send the response back + | to this client's browser, allowing them to enjoy our application. + | + */ + + $app = require_once __DIR__.'/../bootstrap/app.php'; + + $kernel = $app->make(Kernel::class); + + $response = $kernel->handle( + $request = Request::capture() + )->send(); + + $kernel->terminate($request, $response);