Skip to content

Commit afa6313

Browse files
committed
Update the apphost to be compatible with system changes
1 parent 9c5931d commit afa6313

File tree

1 file changed

+13
-24
lines changed

1 file changed

+13
-24
lines changed

bin/apphost

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,23 @@
11
<?php
22

3-
use DevNet\System\Runtime\Launcher;
4-
53
$root = dirname(__FILE__, 2);
64

7-
// Loads local devnet host if exist
5+
// Load the devnet host, the local one or the global one
86
if (is_file($root . '/vendor/devnet/system/host.php')) {
97
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'));
158
} 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+
}
1815

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+
}
2422
}
2523
}
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

Comments
 (0)