Repository navigation
Expand file tree
/
Copy pathhyde
More file actions
executable file
·95 lines (80 loc) · 3.29 KB
/
Copy pathhyde
File metadata and controls
executable file
·95 lines (80 loc) · 3.29 KB
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/env php
<?php
/*
|--------------------------------------------------------------------------
| The HydeCLI
|--------------------------------------------------------------------------
|
| This file is the entry point for the HydeCLI executable. Before anything
| else happens, the launcher works out which of the two kinds of project
| it has been invoked against: a Portable project, whose framework and
| runtime come entirely from this executable, or a Composer project,
| which owns its dependency graph and is handed control of itself.
|
| Detection and dispatch deliberately run before the embedded autoloader
| is registered. That ordering is the guarantee that a Composer project
| never shares a process with the dependencies bundled in the CLI.
|
*/
define('LARAVEL_START', microtime(true));
require_once __DIR__.'/app/Launcher/LauncherException.php';
require_once __DIR__.'/app/Launcher/ProjectType.php';
require_once __DIR__.'/app/Launcher/Project.php';
require_once __DIR__.'/app/Launcher/Platform.php';
require_once __DIR__.'/app/Launcher/ComposerManifest.php';
require_once __DIR__.'/app/Launcher/ProjectDetector.php';
require_once __DIR__.'/app/Launcher/RuntimeManager.php';
require_once __DIR__.'/app/Launcher/Subprocess.php';
require_once __DIR__.'/app/Launcher/ProjectDispatcher.php';
require_once __DIR__.'/app/Launcher/RuntimeDispatcher.php';
require_once __DIR__.'/app/Launcher/Launcher.php';
$launcher = new App\Launcher\Launcher();
try {
$status = $launcher->run($_SERVER['argv'] ?? []);
} catch (Throwable $exception) {
exit($launcher->fail($exception));
}
if ($status !== null) {
// The call was handled by the launcher, which means it was dispatched
// into a Composer project. We exit with that project's exit status.
exit($status);
}
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Now that we know we are running a Portable project (or a command that
| belongs to the CLI itself) we can register the embedded autoloader
| and boot the application that this executable carries with it.
|
*/
require_once __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/app/bootstrap.php';
/*
|--------------------------------------------------------------------------
| Run The HydeCLI 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!
|
*/
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$status = $kernel->handle(
$input = new Symfony\Component\Console\Input\ArgvInput,
new Symfony\Component\Console\Output\ConsoleOutput
);
/*
|--------------------------------------------------------------------------
| Shutdown The Application
|--------------------------------------------------------------------------
|
| Once the HydeCLI 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.
|
*/
$kernel->terminate($input, $status);
exit($status);