File tree Expand file tree Collapse file tree 5 files changed +92
-9
lines changed Expand file tree Collapse file tree 5 files changed +92
-9
lines changed Original file line number Diff line number Diff line change 17
17
18
18
Then a ` main.phar ` will be generated:
19
19
``` shell
20
- ./main.phar
20
+ ./main.phar test
21
21
```
22
22
23
- Head to the [ Box project documentation] ( https://box-project.github.io/box/configuration/ ) to see the full and in details what you can do.
23
+ Head to the [ Box project documentation] ( https://box-project.github.io/box/configuration/ ) to see the full and in details what you can do.
24
+
25
+ > [ !NOTE]
26
+ > This example is using [ minicli] ( https://docs.minicli.dev/en/latest/ ) for demonstration purposes.
Original file line number Diff line number Diff line change 10
10
}
11
11
],
12
12
"minimum-stability" : " stable" ,
13
- "bin" : [" main" ]
13
+ "bin" : [" main" ],
14
+ "require" : {
15
+ "minicli/minicli" : " ^4.2"
16
+ }
14
17
}
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/env php
2
2
<?php
3
3
4
- declare (strict_types=1 );
4
+ if (php_sapi_name () !== 'cli ' ) {
5
+ exit ;
6
+ }
5
7
6
- echo "Hello, phpctl + box \n" ;
8
+ require __DIR__ . '/vendor/autoload.php ' ;
9
+
10
+ use Minicli \App ;
11
+
12
+ $ app = new App ([
13
+ 'app_path ' => [
14
+ __DIR__ . '/app/Command ' ,
15
+ ],
16
+ 'theme ' => '\Unicorn ' ,
17
+ 'debug ' => false ,
18
+ ]);
19
+
20
+ $ app ->registerCommand ('test ' , function () use ($ app ) {
21
+ $ app ->success ('Hello World! ' , false );
22
+ $ app ->info ('With Background! ' , true );
23
+ $ app ->error ('Quitting! ' , false );
24
+ });
25
+
26
+ $ app ->runCommand ($ argv );
Original file line number Diff line number Diff line change 1
- ; zend_extension = xdebug
2
-
3
1
[xdebug]
4
2
xdebug.mode = develop,debug
5
3
xdebug.log = /tmp/xdebug.log
6
4
xdebug.start_with_request = Yes
7
5
8
6
[swoole]
9
7
swoole.use_shortname = Off
8
+
9
+ [phar]
10
+ phar.readonly = Off
You can’t perform that action at this time.
0 commit comments