forked from laravel/laravel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Large refactor of HTTP and Console stack.
- Loading branch information
1 parent
834cb75
commit 4301348
Showing
19 changed files
with
179 additions
and
356 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
app/Console/InspireCommand.php → app/Console/Commands/InspireCommand.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php namespace App\Console; | ||
|
||
use Exception; | ||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; | ||
|
||
class Kernel extends ConsoleKernel { | ||
|
||
/** | ||
* The bootstrap classes for the application. | ||
* | ||
* @return void | ||
*/ | ||
protected $bootstrappers = [ | ||
'Illuminate\Foundation\Bootstrap\LoadEnvironment', | ||
'Illuminate\Foundation\Bootstrap\LoadConfiguration', | ||
'Illuminate\Foundation\Bootstrap\RegisterProviders', | ||
'Illuminate\Foundation\Bootstrap\BootProviders', | ||
]; | ||
|
||
/** | ||
* Run the console application. | ||
* | ||
* @param \Symfony\Component\Console\Input\InputInterface $input | ||
* @param \Symfony\Component\Console\Output\OutputInterface $output | ||
* @return int | ||
*/ | ||
public function handle($input, $output = null) | ||
{ | ||
try | ||
{ | ||
return parent::handle($input, $output); | ||
} | ||
catch (Exception $e) | ||
{ | ||
$output->writeln((string) $e); | ||
|
||
return 1; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php namespace App\Http; | ||
|
||
use Exception; | ||
use Illuminate\Foundation\Http\Kernel as HttpKernel; | ||
|
||
class Kernel extends HttpKernel { | ||
|
||
/** | ||
* The bootstrap classes for the application. | ||
* | ||
* @return void | ||
*/ | ||
protected $bootstrappers = [ | ||
'Illuminate\Foundation\Bootstrap\LoadEnvironment', | ||
'Illuminate\Foundation\Bootstrap\HandleExceptions', | ||
'Illuminate\Foundation\Bootstrap\LoadConfiguration', | ||
'Illuminate\Foundation\Bootstrap\RegisterProviders', | ||
'Illuminate\Foundation\Bootstrap\BootProviders', | ||
]; | ||
|
||
/** | ||
* The application's HTTP middleware stack. | ||
* | ||
* @var array | ||
*/ | ||
protected $stack = [ | ||
'App\Http\Middleware\MaintenanceMiddleware', | ||
'Illuminate\Cookie\Middleware\Guard', | ||
'Illuminate\Cookie\Middleware\Queue', | ||
'Illuminate\Session\Middleware\Reader', | ||
'Illuminate\Session\Middleware\Writer', | ||
'Illuminate\View\Middleware\ErrorBinder', | ||
'App\Http\Middleware\CsrfMiddleware', | ||
]; | ||
|
||
/** | ||
* Handle an incoming HTTP request. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @return \Illuminate\Http\Response | ||
*/ | ||
public function handle($request) | ||
{ | ||
try | ||
{ | ||
return parent::handle($request); | ||
} | ||
catch (Exception $e) | ||
{ | ||
throw $e; | ||
} | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<?php | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Create The Application | ||
|-------------------------------------------------------------------------- | ||
| | ||
| The first thing we will do is create a new Laravel application instance | ||
| which serves as the "glue" for all the components of Laravel, and is | ||
| the IoC container for the system binding all of the various parts. | ||
| | ||
*/ | ||
|
||
$app = new Illuminate\Foundation\Application( | ||
realpath(__DIR__.'/..') | ||
); | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| Create The Application | ||
|-------------------------------------------------------------------------- | ||
| | ||
| The first thing we will do is create a new Laravel application instance | ||
| which serves as the "glue" for all the components of Laravel, and is | ||
| the IoC container for the system binding all of the various parts. | ||
| | ||
*/ | ||
|
||
$app->bind( | ||
'Illuminate\Contracts\Http\Kernel', | ||
'App\Http\Kernel' | ||
); | ||
|
||
$app->bind( | ||
'Illuminate\Contracts\Console\Kernel', | ||
'App\Console\Kernel' | ||
); | ||
|
||
/* | ||
|-------------------------------------------------------------------------- | ||
| 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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.