@@ -46,64 +46,31 @@ public function run($return = false)
4646
4747 switch ($ this ->command ) {
4848
49- case '' :
5049 case '-h ' :
5150 case '--help ' :
52-
51+ case ' help ' :
5352 $ output .= CHelpCommand::handle ();
5453 break ;
5554
5655 case '-v ' :
5756 case '--version ' :
58-
5957 $ output .= CVersionCommand::handle ();
6058 break ;
6159
6260 case 'cache:clear ' :
6361 case 'cache:clear-all ' :
64-
6562 if ($ this ->command === 'cache:clear-all ' ) {
6663 $ this ->param = 'all ' ;
6764 }
6865
69- if (empty ($ this ->param )) {
70- $ output .= CConsole::redbg ("No cache type for deleting is defined. Type cache:clear -help " ) . PHP_EOL ;
71- } elseif ($ this ->param === '-h ' || $ this ->param === '-help ' ) {
72- $ output .= CConsole::yellow ("Usage: " ) . PHP_EOL ;
73- $ output .= " cache:clear-all \tFlush all application cache " . PHP_EOL ;
74- $ output .= " cache:clear [type] \tFlush specific application cache " . PHP_EOL ;
75- $ output .= " \t\t\t[type] - the type of cache to be removed: 'db', 'css', 'js' or 'all' " . PHP_EOL ;
76- } elseif (in_array ($ this ->param , array ('db ' , 'css ' , 'js ' , 'all ' ))) {
77- if ($ this ->param == 'db ' || $ this ->param == 'all ' ){
78- if (CConfig::get ('cache.db.path ' ) == '' ) {
79- $ output .= CConsole::redbg ("Config value 'cache.db.path' is not defined. Check your configuration file. " ) . PHP_EOL ;
80- }else {
81- $ result = CFile::emptyDirectory (CConfig::get ('cache.db.path ' ), array ('index.html ' ));
82- $ output .= 'DB cache ' . ($ result ? 'successfully cleaned ' : 'error ' );
83- }
84- }
85- if ($ this ->param == 'css ' || $ this ->param == 'all ' ){
86- if (CConfig::get ('compression.css.path ' ) == '' ) {
87- $ output .= CConsole::redbg ("Config value 'compression.css.path' is not defined. Check your configuration file. " ) . PHP_EOL ;
88- }else {
89- $ result = CFile::emptyDirectory (CConfig::get ('compression.css.path ' ), array ('index.html ' ));
90- $ output .= 'CSS cache ' . ($ result ? 'successfully cleaned ' : 'error ' );
91- }
92- }
93- if ($ this ->param == 'js ' || $ this ->param == 'all ' ){
94- if (CConfig::get ('compression.js.path ' ) == '' ) {
95- $ output .= CConsole::redbg ("Config value 'compression.js.path' is not defined. Check your configuration file. " ) . PHP_EOL ;
96- }else {
97- $ result = CFile::emptyDirectory (CConfig::get ('compression.js.path ' ), array ('index.html ' ));
98- $ output .= 'JS cache ' . ($ result ? 'successfully cleaned ' : 'error ' );
99- }
100- }
101- }
66+ $ output .= CCacheClearCommand::handle ($ this ->param );
67+ break ;
10268
69+ case 'make:controller ' :
70+ $ output .= CMakeControllerCommand::handle ($ this ->param );
10371 break ;
10472
10573 default :
106-
10774 $ output .= PHP_EOL ;
10875 $ output .= CConsole::redbg ("Command ' " .$ this ->command ."' is not defined. " ) . PHP_EOL ;
10976 $ output .= 'Type "bin/aii --help" to check all commands and options. ' ;
0 commit comments