File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -24,11 +24,16 @@ APP_RUNTIME=Runtime\Laravel\Runtime
2424
2525use Illuminate\Contracts\Http\Kernel;
2626
27+ define('LARAVEL_START', microtime(true));
28+
2729require_once dirname(__DIR__).'/vendor/autoload_runtime.php';
2830
29- return function () {
30- define('LARAVEL_START', microtime(true));
31- $app = require_once __DIR__ . '/../bootstrap/app.php';
31+ return function (): Kernel {
32+ static $app;
33+
34+ if (null === $app) {
35+ $app = require dirname(__DIR__).'/bootstrap/app.php';
36+ }
3237
3338 return $app->make(Kernel::class);
3439};
@@ -41,13 +46,17 @@ return function () {
4146
4247use Illuminate\Contracts\Console\Kernel;
4348
49+ define('LARAVEL_START', microtime(true));
50+
4451require_once __DIR__.'/vendor/autoload_runtime.php';
4552
46- return function () {
47- define('LARAVEL_START', microtime(true));
48- $app = require_once __DIR__.'/bootstrap/app.php';
53+ return function (): Kernel {
54+ static $app;
55+
56+ if (null === $app) {
57+ $app = require __DIR__.'/bootstrap/app.php';
58+ }
4959
5060 return $app->make(Kernel::class);
5161};
52-
5362```
You can’t perform that action at this time.
0 commit comments