This repository was archived by the owner on Mar 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Expand file tree Collapse file tree 2 files changed +30
-2
lines changed Original file line number Diff line number Diff line change 11{
2- "name" : " mpyw/HyperBuiltinServer " ,
2+ "name" : " mpyw/php-hyper-builtin-server " ,
33 "description" : " Reverse proxy for PHP built-in server which supports multiprocessing and TLS/SSL encryption" ,
44 "type" : " project" ,
55 "license" : " MIT" ,
3838 " .*" ,
3939 " !/src/*"
4040 ]
41- }
41+ },
42+ "bin" : [" hyper-run" ]
4243}
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env php
2+ <?php
3+
4+ declare (ticks=1 );
5+ set_time_limit (0 );
6+
7+ if (PHP_SAPI !== 'cli ' ) {
8+ header ('Content-Type: text/plain; charset=UTF-8 ' , true , 400 );
9+ exit ("This script only works on php-cli. \n" );
10+ }
11+ if (DIRECTORY_SEPARATOR !== '/ ' ) {
12+ fwrite (STDERR , "Windows is not supported. \n" );
13+ exit (1 );
14+ }
15+ if (!isset ($ _SERVER ['argv ' ][1 ])) {
16+ fwrite (STDERR , "Usage: {$ _SERVER ['argv ' ][0 ]} <DocumentRoot> \n" );
17+ exit (1 );
18+ }
19+ $ dir = $ _SERVER ['argv ' ][1 ];
20+ if (!is_dir ($ dir )) {
21+ fwrite (STDERR , "No such directory: $ dir \n" );
22+ exit (1 );
23+ }
24+
25+ require __DIR__ . '/autoload.php ' ;
26+ $ ps = new mpyw \HyperBuiltinServer \MasterProcess ($ dir );
27+ $ ps ->listen ();
You can’t perform that action at this time.
0 commit comments