/**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $vendor = $input->getArgument('connection');
     $vendor = preg_split('{:}', $vendor);
     $vendor = ucfirst($vendor[0]);
     $generatorConfig = $this->getGeneratorConfig(array('propel.platform.class' => $input->getOption('platform'), 'propel.reverse.parser.class' => sprintf('\\Propel\\Generator\\Reverse\\%sSchemaParser', $vendor)), $input);
     $this->createDirectory($input->getOption('output-dir'));
     $manager = new ReverseManager(new XmlDumper());
     $manager->setGeneratorConfig($generatorConfig);
     $manager->setLoggerClosure(function ($message) use($input, $output) {
         if ($input->getOption('verbose')) {
             $output->writeln($message);
         }
     });
     $manager->setWorkingDirectory($input->getOption('output-dir'));
     list(, $dsn, $infos) = $this->parseConnection('connection=' . $input->getArgument('connection'));
     $manager->setConnection(array_merge(array('dsn' => $dsn), $infos));
     $manager->setDatabaseName($input->getOption('database-name'));
     $manager->setSchemaName($input->getOption('schema-name'));
     if (true === $manager->reverse()) {
         $output->writeln('<info>Schema reverse engineering finished.</info>');
     } else {
         $more = $input->getOption('verbose') ? '' : ' You can use the --verbose option to get more information.';
         $output->writeln(sprintf('<error>Schema reverse engineering failed.%s</error>', $more));
     }
 }
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $configOptions = [];
     $connection = $input->getArgument('connection');
     if (false === strpos($connection, ':')) {
         //treat it as connection name
         $configOptions['propel']['reverse']['connection'] = $connection;
         if (!$input->getOption('database-name')) {
             $input->setOption('database-name', $connection);
         }
     } else {
         //probably a dsn
         $configOptions += $this->connectionToProperties('reverseconnection=' . $connection, 'reverse');
         $configOptions['propel']['reverse']['parserClass'] = sprintf('\\Propel\\Generator\\Reverse\\%sSchemaParser', ucfirst($configOptions['propel']['database']['connections']['reverseconnection']['adapter']));
         if (!$input->getOption('database-name')) {
             $input->setOption('database-name', self::DEFAULT_DATABASE_NAME);
         }
     }
     $generatorConfig = $this->getGeneratorConfig($configOptions, $input);
     $this->createDirectory($input->getOption('output-dir'));
     $manager = new ReverseManager(new XmlDumper());
     $manager->setGeneratorConfig($generatorConfig);
     $manager->setLoggerClosure(function ($message) use($input, $output) {
         if ($input->getOption('verbose')) {
             $output->writeln($message);
         }
     });
     $manager->setWorkingDirectory($input->getOption('output-dir'));
     $manager->setDatabaseName($input->getOption('database-name'));
     $manager->setSchemaName($input->getOption('schema-name'));
     if (true === $manager->reverse()) {
         $output->writeln('<info>Schema reverse engineering finished.</info>');
     }
 }
 /**
  * {@inheritdoc}
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $configOptions = array();
     if ($this->hasInputArgument('connection', $input)) {
         $configOptions += $this->connectionToProperties('reverseconnection=' . $input->getArgument('connection'), 'reverse');
         $configOptions['propel']['reverse']['parserClass'] = sprintf('\\Propel\\Generator\\Reverse\\%sSchemaParser', ucfirst($configOptions['propel']['database']['connections']['reverseconnection']['adapter']));
     }
     $generatorConfig = $this->getGeneratorConfig($configOptions, $input);
     $this->createDirectory($input->getOption('output-dir'));
     $manager = new ReverseManager(new XmlDumper());
     $manager->setGeneratorConfig($generatorConfig);
     $manager->setLoggerClosure(function ($message) use($input, $output) {
         if ($input->getOption('verbose')) {
             $output->writeln($message);
         }
     });
     $manager->setWorkingDirectory($input->getOption('output-dir'));
     $manager->setDatabaseName($input->getOption('database-name'));
     $manager->setSchemaName($input->getOption('schema-name'));
     if (true === $manager->reverse()) {
         $output->writeln('<info>Schema reverse engineering finished.</info>');
     } else {
         $more = $input->getOption('verbose') ? '' : ' You can use the --verbose option to get more information.';
         $output->writeln(sprintf('<error>Schema reverse engineering failed.%s</error>', $more));
         return 1;
     }
 }