Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pterodactyl
GitHub Repository: pterodactyl/panel
Path: blob/1.0-develop/bootstrap/app.php
7432 views
1
<?php
2
3
/*
4
|--------------------------------------------------------------------------
5
| Create The Application
6
|--------------------------------------------------------------------------
7
|
8
| The first thing we will do is create a new Laravel application instance
9
| which serves as the "glue" for all the components of Laravel, and is
10
| the IoC container for the system binding all of the various parts.
11
|
12
*/
13
14
$app = new Illuminate\Foundation\Application(
15
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
16
);
17
18
if (isset($_ENV['APP_STORAGE_PATH'])) {
19
$app->useStoragePath($_ENV['APP_STORAGE_PATH']);
20
}
21
22
/*
23
|--------------------------------------------------------------------------
24
| Bind Important Interfaces
25
|--------------------------------------------------------------------------
26
|
27
| Next, we need to bind some important interfaces into the container so
28
| we will be able to resolve them when needed. The kernels serve the
29
| incoming requests to this application from both the web and CLI.
30
|
31
*/
32
33
$app->singleton(
34
Illuminate\Contracts\Http\Kernel::class,
35
Pterodactyl\Http\Kernel::class
36
);
37
38
$app->singleton(
39
Illuminate\Contracts\Console\Kernel::class,
40
Pterodactyl\Console\Kernel::class
41
);
42
43
$app->singleton(
44
Illuminate\Contracts\Debug\ExceptionHandler::class,
45
Pterodactyl\Exceptions\Handler::class
46
);
47
48
/*
49
|--------------------------------------------------------------------------
50
| Return The Application
51
|--------------------------------------------------------------------------
52
|
53
| This script returns the application instance. The instance is given to
54
| the calling script so we can separate the building of the instances
55
| from the actual running of the application and sending responses.
56
|
57
*/
58
59
return $app;
60
61