Skip to content

Commit 81563fb

Browse files
committed
Fix the loading of the host file
remove the duplicated loading of the local and global classes.
1 parent 8fa7175 commit 81563fb

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

host.php

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,19 @@
66
* @link https://github.com/DevNet-Framework
77
*/
88

9-
use DevNet\System\Runtime\ClassLoader;
9+
use DevNet\System\Runtime\Launcher;
1010

11-
require_once __DIR__ . '/lib/Runtime/ClassLoader.php';
11+
require_once dirname(__FILE__, 3) . '/autoload.php';
1212

13-
$loader = new ClassLoader(dirname(__DIR__));
13+
// Load the local composer autoload if exit.
14+
if (is_file($root . '/vendor/autoload.php')) {
15+
require_once $root . '/vendor/autoload.php';
16+
}
1417

15-
$loader->mapNamespace('DevNet\\System', 'system/lib/');
16-
$loader->mapNamespace('DevNet\\Core', 'core/lib/');
17-
$loader->mapNamespace('DevNet\\Common', 'common/lib/');
18-
$loader->mapNamespace('DevNet\\Http', 'http/lib/');
19-
$loader->mapNamespace('DevNet\\Security', 'security/lib/');
20-
$loader->mapNamespace('DevNet\\ORM', 'orm/lib/');
21-
$loader->mapNamespace('DevNet\\ORM\\MySql', 'orm/lib/Providers/MySql/');
22-
$loader->mapNamespace('DevNet\\ORM\\PgSql', 'orm/lib/Providers/PgSql/');
23-
$loader->mapNamespace('DevNet\\ORM\\Sqlite', 'orm/lib/Providers/Sqlite/');
24-
$loader->include(__DIR__ . '/global.php');
25-
26-
$loader->register();
18+
// Get the console arguments without command name
19+
$args = $GLOBALS['argv'] ?? [];
20+
array_shift($args);
2721

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

0 commit comments

Comments
 (0)