From 56af58fcb82e85bcd60b3ffba3680356c123c9d9 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sun, 14 Aug 2016 09:11:46 +0200 Subject: [PATCH] Created installation script and installation command --- module/CLI/src/Command/Install/InstallCommand.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/module/CLI/src/Command/Install/InstallCommand.php b/module/CLI/src/Command/Install/InstallCommand.php index 2e3b0af3..b4b0d3e1 100644 --- a/module/CLI/src/Command/Install/InstallCommand.php +++ b/module/CLI/src/Command/Install/InstallCommand.php @@ -36,6 +36,8 @@ class InstallCommand extends Command ]); $params['DB_NAME'] = $this->ask('Database name', 'shlink'); + $params['DB_USER'] = $this->ask('Database username'); + $params['DB_PASSWORD'] = $this->ask('Database password'); } /** @@ -51,9 +53,14 @@ class InstallCommand extends Command if (isset($default)) { $text .= ' (defaults to ' . $default . ')'; } - return $questionHelper->ask($this->input, $this->output, new Question( - ' ' . $text . ': ', - $default - )); + $value = ''; + while (empty($value) && empty($default)) { + $value = $questionHelper->ask($this->input, $this->output, new Question( + ' ' . $text . ': ', + $default + )); + } + + return $value; } }