Skip to content

Commit 6b94db9

Browse files
committed
Enahnce the CLI start screen
1 parent d5e619f commit 6b94db9

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

console/create.php

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,54 @@ protected function interact(InputInterface $input, OutputInterface $output)
114114

115115
$this->helper = $this->getHelper('question');
116116

117+
$this->display_banner();
118+
117119
$output->writeln($this->language->lang('SKELETON_CLI_COMPOSER_QUESTIONS'));
118120
$this->get_composer_data();
119121

120122
$output->writeln($this->language->lang('SKELETON_CLI_COMPONENT_QUESTIONS'));
121123
$this->get_component_data();
122124
}
123125

126+
/**
127+
* Display a colorful ASCII art title banner.
128+
*/
129+
protected function display_banner(): void
130+
{
131+
$title_lines = [
132+
[' _____ __ __ __ ', 'cyan'],
133+
[' / ___// /_____ / /__ / /_____ ____ ', 'cyan'],
134+
[' \__ \/ //_/ _ \/ / _ \/ __/ __ \/ __ \ ', 'blue'],
135+
[' ___/ / ,< / __/ / __/ /_/ /_/ / / / / ', 'blue'],
136+
['/____/_/|_|\___/_/\___/\__/\____/_/ /_/ ', 'magenta'],
137+
];
138+
139+
$sub_lines = [
140+
[' ______ __ _ ', 'magenta'],
141+
[' / ____/ __/ /____ ____ _____(_)___ ____ ', 'red'],
142+
[' / __/ | |/_/ __/ _ \/ __ \/ ___/ / __ \/ __ \ ', 'red'],
143+
[' / /____> </ /_/ __/ / / (__ ) / /_/ / / / / ', 'yellow'],
144+
['/_____/_/|_|\__/\___/_/ /_/____/_/\____/_/ /_/ ', 'yellow'],
145+
];
146+
147+
$desc = $this->language->lang('SKELETON_CLI_BANNER_DESC');
148+
$line = str_repeat('', 50);
149+
150+
$this->output->writeln('');
151+
foreach ($title_lines as [$text, $color])
152+
{
153+
$this->output->writeln("<fg=$color;options=bold>$text</>");
154+
}
155+
foreach ($sub_lines as [$text, $color])
156+
{
157+
$this->output->writeln("<fg=$color;options=bold>$text</>");
158+
}
159+
$this->output->writeln('');
160+
$this->output->writeln("<fg=cyan> $desc </>");
161+
$this->output->writeln("<fg=white>$line</>");
162+
$this->output->writeln('');
163+
}
164+
124165
/**
125166
* Get composer data from the user
126167
*/

language/en/common.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
'PHPBB_CREATE_SKELETON_EXPLAIN' => 'Generate your extension’s foundation in seconds. No more setting up files by hand — Skeleton builds it all for you, with clean, fully documented templates based on phpBB’s best practices. Before you begin, be sure to review the 📖 [<a href="%1$s" target="_blank">Skeleton Extension Documentation</a>], 🛡️ [<a href="%2$s" target="_blank">Extension Validation Rules</a>], and 🛠️ [<a href="%3$s" target="_blank">Coding Guidelines</a>].',
2929
'PHPBB_SKELETON_EXT_HELP' => 'Learn More',
3030

31+
'SKELETON_CLI_BANNER_DESC' => 'The official phpBB skeleton extension generator',
32+
3133
'EXTENSION_CLI_SKELETON_SUCCESS' => "<info>Extension created successfully.\nCopy the extension from `store/tmp-ext/` into the `ext/` folder.</info>",
3234
'SKELETON_CLI_COMPOSER_QUESTIONS' => '<comment>Enter composer.json details (hit enter to leave an option empty)</comment>',
3335
'SKELETON_CLI_COMPONENT_QUESTIONS' => '<comment>Install optional components. Default: No; [y/n]</comment>',

0 commit comments

Comments
 (0)