-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from DevNet-Framework/1.1
Update the apphost to be compatible with system changes
- Loading branch information
Showing
1 changed file
with
13 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |