File tree Expand file tree Collapse file tree 3 files changed +38
-68
lines changed
Expand file tree Collapse file tree 3 files changed +38
-68
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use DevNet\System\Runtime\Launcher;
4+
5+ $projectFile = simplexml_load_file(__DIR__ . "/../project.phproj");
6+ $namespace = $projectFile->properties->namespace;
7+ $entrypoint = $projectFile->properties->entrypoint;
8+ $packages = $projectFile->dependencies->package ?? [];
9+
10+ if (PHP_OS_FAMILY == 'Windows') {
11+ $path = getenv('path');
12+ $paths = explode(';', $path);
13+ } else {
14+ $path = getenv('PATH');
15+ $paths = explode(':', $path);
16+ }
17+
18+ foreach ($paths as $path) {
19+ if (file_exists($path . '/../autoload.php')) {
20+ require $path . '/../autoload.php';
21+ break;
22+ }
23+ }
24+
25+ foreach ($packages as $package) {
26+ $include = (string)$package->attributes()->include;
27+ if (file_exists(__DIR__ . '/../' . $include)) {
28+ require __DIR__ . '/../' . $include;
29+ }
30+ }
31+
32+ $launcher = Launcher::getLauncher();
33+ $launcher->workspace(dirname(__DIR__));
34+ $launcher->namespace((string)$namespace);
35+ $launcher->entryPoint((string)$entrypoint);
36+ $launcher->launch();
Original file line number Diff line number Diff line change 11#!/usr/bin/env php
22<?php
33
4- use DevNet \System \Runtime \launcher ;
5-
6- $ projectFile = simplexml_load_file (__DIR__ . "/../project.phproj " );
7- $ namespace = $ projectFile ->properties ->namespace ;
8- $ entrypoint = $ projectFile ->properties ->entrypoint ;
9- $ packages = $ projectFile ->dependencies ->package ?? [];
10-
11- if (PHP_OS_FAMILY == 'Windows ' ) {
12- $ path = getenv ('path ' );
13- $ paths = explode ('; ' , $ path );
14- } else {
15- $ path = getenv ('PATH ' );
16- $ paths = explode (': ' , $ path );
17- }
18-
19- foreach ($ paths as $ path ) {
20- if (file_exists ($ path . '/../autoload.php ' )) {
21- require $ path . '/../autoload.php ' ;
22- break ;
23- }
24- }
25-
26- foreach ($ packages as $ package ) {
27- $ include = (string )$ package ->attributes ()->include ;
28- if (file_exists (__DIR__ . '/../ ' . $ include )) {
29- require __DIR__ . '/../ ' . $ include ;
30- }
31- }
32-
33- $ launcher = launcher::getLauncher ();
34- $ launcher ->workspace (dirname (__DIR__ ));
35- $ launcher ->namespace ((string )$ namespace );
36- $ launcher ->entryPoint ((string )$ entrypoint );
37- $ launcher ->launch ();
4+ require 'apphost ' ;
Original file line number Diff line number Diff line change 11<?php
22
3- use DevNet \System \Runtime \launcher ;
4-
5- $ projectFile = simplexml_load_file (__DIR__ . "/../project.phproj " );
6- $ namespace = $ projectFile ->properties ->namespace ;
7- $ entrypoint = $ projectFile ->properties ->entrypoint ;
8- $ packages = $ projectFile ->dependencies ->package ?? [];
9-
10- if (PHP_OS_FAMILY == 'Windows ' ) {
11- $ path = getenv ('path ' );
12- $ paths = explode ('; ' , $ path );
13- } else {
14- $ path = getenv ('PATH ' );
15- $ paths = explode (': ' , $ path );
16- }
17-
18- foreach ($ paths as $ path ) {
19- if (file_exists ($ path . '/../autoload.php ' )) {
20- require $ path . '/../autoload.php ' ;
21- break ;
22- }
23- }
24-
25- foreach ($ packages as $ package ) {
26- $ include = (string )$ package ->attributes ()->include ;
27- if (file_exists (__DIR__ . '/../ ' . $ include )) {
28- require __DIR__ . '/../ ' . $ include ;
29- }
30- }
31-
32- $ launcher = launcher::getLauncher ();
33- $ launcher ->workspace (dirname (__DIR__ ));
34- $ launcher ->namespace ((string )$ namespace );
35- $ launcher ->entryPoint ((string )$ entrypoint );
36- $ launcher ->launch ();
3+ require '../bin/apphost ' ;
You can’t perform that action at this time.
0 commit comments