File tree Expand file tree Collapse file tree 1 file changed +37
-0
lines changed
Expand file tree Collapse file tree 1 file changed +37
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/env php
2+ <?php
3+
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 ();
You can’t perform that action at this time.
0 commit comments