File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,26 @@ if (isset($options['prepend'])) {
5050 require $ options ['prepend ' ];
5151}
5252unset($ options );
53+ if (!isset (getopt ('' , ['prepend: ' ])['prepend ' ])) {
54+ (function () {
55+ $ prepend = null ;
56+ foreach ($ _SERVER ['argv ' ] as $ index => $ argv ) {
57+ // --prepend /path/to/file
58+ if ($ argv === '--prepend ' ) {
59+ $ prepend = $ _SERVER ['argv ' ][$ index + 1 ] ?? null ;
60+ break ;
61+ }
62+ // --prepend=/path/to/file
63+ if (strpos ($ argv , '--prepend= ' ) === 0 ) {
64+ $ prepend = substr ($ argv , 10 );
65+ break ;
66+ }
67+ }
68+ if ($ prepend !== null && file_exists ($ prepend )) {
69+ require $ prepend ;
70+ }
71+ })();
72+ }
5373require PHPUNIT_COMPOSER_INSTALL ;
5474$ code = 0 ;
5575Swoole \Coroutine::set (['hook_flags ' => SWOOLE_HOOK_ALL , 'exit_condition ' => function () {
You can’t perform that action at this time.
0 commit comments