File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
system/Commands/Generators Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 1212namespace CodeIgniter \Commands \Generators ;
1313
1414use CodeIgniter \CLI \BaseCommand ;
15- use CodeIgniter \CLI \CLI ;
1615use CodeIgniter \CLI \GeneratorTrait ;
1716
1817/**
19- * Generates a skeleton Config file.
18+ * Generates a skeleton config file.
2019 */
2120class ConfigGenerator extends BaseCommand
2221{
@@ -93,9 +92,13 @@ public function run(array $params)
9392 */
9493 protected function prepare (string $ class ): string
9594 {
96- $ namespace = $ this ->getOption ('namespace ' );
97- $ namespace = is_string ($ namespace ) ? $ namespace . '\\' . $ this ->directory : $ this ->directory ;
95+ $ namespace = $ this ->getOption ('namespace ' ) ?? APP_NAMESPACE ;
9896
99- return $ this ->parseTemplate ($ class , ['{namespace} ' ], [$ namespace ]);
97+ if ($ namespace === APP_NAMESPACE )
98+ {
99+ $ class = substr ($ class , strlen ($ namespace . '\\' ));
100+ }
101+
102+ return $ this ->parseTemplate ($ class );
100103 }
101104}
You can’t perform that action at this time.
0 commit comments