|
1 | 1 | <?php |
2 | 2 |
|
3 | | -use DevNet\System\Runtime\Launcher; |
4 | | - |
5 | 3 | $root = dirname(__FILE__, 2); |
6 | 4 |
|
7 | | -// Loads local devnet host if exist |
| 5 | +// Load the devnet host, the local one or the global one |
8 | 6 | if (is_file($root . '/vendor/devnet/system/host.php')) { |
9 | 7 | require $root . '/vendor/devnet/system/host.php'; |
10 | | -} |
11 | | - |
12 | | -// Gets the path environment variable |
13 | | -if (PHP_OS_FAMILY == 'Windows') { |
14 | | - $paths = explode(';', getenv('path')); |
15 | 8 | } else { |
16 | | - $paths = explode(':', getenv('PATH')); |
17 | | -} |
| 9 | + // Get the path environment variable |
| 10 | + if (PHP_OS_FAMILY == 'Windows') { |
| 11 | + $paths = explode(';', getenv('path')); |
| 12 | + } else { |
| 13 | + $paths = explode(':', getenv('PATH')); |
| 14 | + } |
18 | 15 |
|
19 | | -// Search for the global devnet host |
20 | | -foreach ($paths as $path) { |
21 | | - if (is_file($path . '/../devnet/system/host.php')) { |
22 | | - require $path . '/../devnet/system/host.php'; |
23 | | - break; |
| 16 | + // Search for the global devnet host |
| 17 | + foreach ($paths as $path) { |
| 18 | + if (is_file($path . '/../devnet/system/host.php')) { |
| 19 | + require $path . '/../devnet/system/host.php'; |
| 20 | + break; |
| 21 | + } |
24 | 22 | } |
25 | 23 | } |
26 | | - |
27 | | - |
28 | | -// Gets the console arguments without command name |
29 | | -$args = $GLOBALS['argv'] ?? []; |
30 | | -array_shift($args); |
31 | | - |
32 | | -// Initialize and launch the application |
33 | | -$launcher = Launcher::initialize($root . '/devnet.proj'); |
34 | | -$launcher->launch($args); |
0 commit comments