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/app.php b/bootstrap/app.php index 037e17df0..c56e46699 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -1,55 +1,55 @@ singleton( - Illuminate\Contracts\Http\Kernel::class, - App\Http\Kernel::class -); + $app->singleton( + Illuminate\Contracts\Http\Kernel::class, + App\Http\Kernel::class + ); -$app->singleton( - Illuminate\Contracts\Console\Kernel::class, - App\Console\Kernel::class -); + $app->singleton( + Illuminate\Contracts\Console\Kernel::class, + App\Console\Kernel::class + ); -$app->singleton( - Illuminate\Contracts\Debug\ExceptionHandler::class, - App\Exceptions\Handler::class -); + $app->singleton( + Illuminate\Contracts\Debug\ExceptionHandler::class, + App\Exceptions\Handler::class + ); -/* -|-------------------------------------------------------------------------- -| Return The Application -|-------------------------------------------------------------------------- -| -| This script returns the application instance. The instance is given to -| the calling script so we can separate the building of the instances -| from the actual running of the application and sending responses. -| -*/ + /* + |-------------------------------------------------------------------------- + | Return The Application + |-------------------------------------------------------------------------- + | + | This script returns the application instance. The instance is given to + | the calling script so we can separate the building of the instances + | from the actual running of the application and sending responses. + | + */ -return $app; + return $app; diff --git a/bootstrap/autoload.php b/bootstrap/autoload.php deleted file mode 100644 index eec58a304..000000000 --- a/bootstrap/autoload.php +++ /dev/null @@ -1,15 +0,0 @@ -make(); - -$dotenv = Dotenv::create($repository, dirname(__DIR__, 1), null)->load(); - -$app->make(Illuminate\Contracts\Console\Kernel::class)->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); diff --git a/server.php b/server.php deleted file mode 100644 index 20bc389f0..000000000 --- a/server.php +++ /dev/null @@ -1,19 +0,0 @@ - - */ -$uri = urldecode( - parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH) -); - -// This file allows us to emulate Apache's "mod_rewrite" functionality from the -// built-in PHP web server. This provides a convenient way to test a Laravel -// application without having installed a "real" web server software here. -if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) { - return false; -} - -require_once __DIR__.'/public/index.php';