Ejemplo n.º 1
0
 /**
  * Override some variables in the config with parameters from the command line.
  *
  * @param DumperConfigurationInterface $config
  * @param InputInterface               $input
  */
 private function overrideConfigs(DumperConfigurationInterface $config, InputInterface $input)
 {
     if ($input->hasOption('password')) {
         $config->getDatabaseConfig()->setPassword($input->getOption('password'));
     }
     if ($input->getOption('disable-limits')) {
         foreach ($config->getTableConfigs() as $tableConfig) {
             $tableConfig->setLimit(null);
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * Create a new SqlDataConvert by reading the configuration and adding converters for the sql dumper.
  *
  * @param DumperConfigurationInterface $config
  */
 public function __construct(DumperConfigurationInterface $config)
 {
     foreach ($config->getTableConfigs() as $tableName => $tableConfig) {
         foreach ($tableConfig->getConverters() as $columnName => $converterDefinitions) {
             $key = sprintf('%s.%s', $tableName, $columnName);
             foreach ($converterDefinitions as $converterDefinition) {
                 $converter = $this->createConverterInstance($converterDefinition);
                 $this->addConverter($key, $converter, true);
             }
         }
     }
 }