Improved and simplified all installation process thanks to symfony style

This commit is contained in:
Alejandro Celaya
2017-12-28 15:52:10 +01:00
parent 5de845c258
commit 4dffc9f0c1
11 changed files with 102 additions and 221 deletions

View File

@@ -7,7 +7,7 @@ use Shlinkio\Shlink\CLI\Model\CustomizableAppConfig;
use Shlinkio\Shlink\Common\Util\StringUtilsTrait;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;
use Symfony\Component\Console\Style\SymfonyStyle;
class ApplicationConfigCustomizerPlugin extends AbstractConfigCustomizerPlugin
{
@@ -22,18 +22,18 @@ class ApplicationConfigCustomizerPlugin extends AbstractConfigCustomizerPlugin
*/
public function process(InputInterface $input, OutputInterface $output, CustomizableAppConfig $appConfig)
{
$this->printTitle($output, 'APPLICATION');
$io = new SymfonyStyle($input, $output);
$io->title('APPLICATION');
if ($appConfig->hasApp() && $this->questionHelper->ask($input, $output, new ConfirmationQuestion(
if ($appConfig->hasApp() && $io->confirm(
'<question>Do you want to keep imported application config? (Y/n):</question> '
))) {
)) {
return;
}
$appConfig->setApp([
'SECRET' => $this->ask(
$input,
$output,
$io,
'Define a secret string that will be used to sign API tokens (leave empty to autogenerate one)',
null,
true