File tree 3 files changed +75
-0
lines changed
3 files changed +75
-0
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ namespace command ;
3
+ use GenPHP \Flavor \BaseGenerator ;
4
+ use GenPHP \Flavor \FlavorDirectory ;
5
+ use GenPHP \Path ;
6
+ use Exception ;
7
+
8
+ class Generator extends BaseGenerator
9
+ {
10
+
11
+ public function brief ()
12
+ {
13
+ return "phpbrew command generator " ;
14
+ }
15
+
16
+ /**
17
+ * generate new flavor
18
+ *
19
+ * @param string $name flavor name, lower case, alphabets
20
+ * @param string $path your code base path
21
+ */
22
+ public function generate ($ commandName )
23
+ {
24
+ $ commandClass = ucfirst ($ commandName ) . 'Command ' ;
25
+ $ commandFile = 'src ' . DIRECTORY_SEPARATOR . 'PhpBrew ' . DIRECTORY_SEPARATOR . 'Command ' . DIRECTORY_SEPARATOR . $ commandClass . '.php ' ;
26
+ $ this ->render ( 'Command.php.twig ' , $ commandFile , array (
27
+ 'commandClass ' => $ commandClass ,
28
+ 'brief ' => 'new command ' ,
29
+ ));
30
+ }
31
+ }
Original file line number Diff line number Diff line change
1
+ * .lo
2
+ * .la
3
+ missing
4
+ mkinstalldirs
5
+ Makefile
6
+ Makefile. *
7
+ configure
8
+ configure.in
9
+ config.status
10
+ config.sub
11
+ config.nice
12
+ config.log
13
+ config.guess
14
+ config.h. *
15
+ config.h
16
+ acinclude.m4
17
+ aclocal.m4
18
+ autom4te.cache
19
+ build
20
+ install-sh
21
+ run-tests.php
22
+ .deps
23
+ libtool
24
+ ltmain.sh
25
+ .gdbinit
26
+ /vendor /
27
+ .libs /
28
+ modules /
Original file line number Diff line number Diff line change
1
+ <?php
2
+ namespace PhpBrew\Command ;
3
+ use CLIFramework\Command ;
4
+
5
+ class {{commandClass }} extends Command
6
+ {
7
+ public function brief ()
8
+ {
9
+ return ' {{brief}}' ;
10
+ }
11
+
12
+ public function execute ()
13
+ {
14
+ echo ' Not implemented yet' ;
15
+ }
16
+ }
You can’t perform that action at this time.
0 commit comments