laravel

先看看一些简单的代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34



/*
|--------------------------------------------------------------------------
| 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 IlluminateFoundationApplication(
realpath(__DIR__.'/../')
);

$app->singleton(
IlluminateContractsHttpKernel::class,
AppHttpKernel::class
);

$app->singleton(
IlluminateContractsConsoleKernel::class,
AppConsoleKernel::class
);

$app->singleton(
IlluminateContractsDebugExceptionHandler::class,
AppExceptionsHandler::class
);

return $app;