private function askGenericOptions(InputInterface $input, IoService $ioService)
{
$required = array('admin-username' => 'backend user name', 'admin-password' => 'backend user password', 'admin-name' => 'your full name', 'admin-email' => 'your email');
$config = $this->getConfig();
foreach ($required as $field => $description) {
// If field was set via cli option, use that
if ($input->getOption($field)) {
continue;
}
// else: check if the option is configured via config
if (isset($config['ShopConfig']) && isset($config['ShopConfig'][$field])) {
$input->setOption($field, $config['ShopConfig'][$field]);
continue;
}
//
$fieldData = $ioService->askAndValidate("Please enter {$description}: ", array($this, 'genericValidator'));
$input->setOption($field, $fieldData);
}
}