Пример #1
0
 protected function askDbDsn()
 {
     $db_type = $this->getContainer()->getParameter('db_type');
     return $this->createPrompt($db_type)->setAsk(function ($default, InputInterface $input, OutputInterface $output, DialogHelper $dialog) {
         $value = $dialog->askAndValidate($output, "Enter dsn> ", function ($dsn) {
             return ConfigCommand::validateDsn($dsn);
         }, FALSE, $default);
         return empty($value) ? FALSE : $value;
     });
 }
Пример #2
0
 protected function askMysqlDsn()
 {
     return $this->createPrompt('mysql_dsn')->setAsk(function ($default, InputInterface $input, OutputInterface $output, DialogHelper $dialog) {
         $value = $dialog->askAndValidate($output, "Enter mysql_dsn> ", function ($dsn) {
             return ConfigCommand::validateDsn($dsn);
         }, FALSE, $default);
         return empty($value) ? FALSE : $value;
     });
 }