Skip to content

Commit

Permalink
Merge pull request #1 from DevNet-Framework/1.1
Browse files Browse the repository at this point in the history
Update the apphost to be compatible with system changes
  • Loading branch information
Maometos authored Dec 20, 2024
2 parents 141ff27 + 33031c9 commit 3900ef7
Showing 1 changed file with 13 additions and 24 deletions.
37 changes: 13 additions & 24 deletions bin/apphost
Original file line number Diff line number Diff line change
@@ -1,34 +1,23 @@
<?php

use DevNet\System\Runtime\Launcher;

$root = dirname(__FILE__, 2);

// Loads local devnet host if exist
// Load the devnet host, the local one or the global one
if (is_file($root . '/vendor/devnet/system/host.php')) {
require $root . '/vendor/devnet/system/host.php';
}

// Gets the path environment variable
if (PHP_OS_FAMILY == 'Windows') {
$paths = explode(';', getenv('path'));
} else {
$paths = explode(':', getenv('PATH'));
}
// Get the path environment variable
if (PHP_OS_FAMILY == 'Windows') {
$paths = explode(';', getenv('path'));
} else {
$paths = explode(':', getenv('PATH'));
}

// Search for the global devnet host
foreach ($paths as $path) {
if (is_file($path . '/../devnet/system/host.php')) {
require $path . '/../devnet/system/host.php';
break;
// Search for the global devnet host
foreach ($paths as $path) {
if (is_file($path . '/../devnet/system/host.php')) {
require $path . '/../devnet/system/host.php';
break;
}
}
}


// Gets the console arguments without command name
$args = $GLOBALS['argv'] ?? [];
array_shift($args);

// Initialize and launch the application
$launcher = Launcher::initialize($root . '/devnet.proj');
$launcher->launch($args);

0 comments on commit 3900ef7

Please sign in to comment.