/** * Executes the compare command. * * @param InputInterface $input * @param OutputInterface $output * * @return int */ protected function execute(InputInterface $input, OutputInterface $output) { $this->io = new StratumStyle($input, $output); $this->io->title('Compare dumped files'); $config_filename = $input->getArgument('config filename'); $remote_filename = $input->getArgument('remote filename'); $local_filename = $input->getArgument('local filename'); $compare_master_data = new CompareMasterData($config_filename, $this->io); $compare_master_data->compare($remote_filename, $local_filename); return 0; }
/** * Executes the Dump data command. * * @param InputInterface $input * @param OutputInterface $output * * @return integer */ protected function execute(InputInterface $input, OutputInterface $output) { $this->io = new StratumStyle($input, $output); $this->io->title('Dump master data'); $config_filename = $input->getArgument('config filename'); $dump_data_filename = $input->getArgument('dump-data filename'); // Open JSON file for getting data. $this->config = new Config($config_filename, $this->io); // Open connection with database. $data_layer = new DataLayer(); $data_layer::connect($this->config->data['database']['host_name'], $this->config->data['database']['user_name'], $this->config->data['database']['password'], $this->config->data['database']['data_schema']); $data_layer::setIo($this->io); // Update config file. $this->config->updateConfigFile($data_layer); // Dumping master data. $dump_master_data = new DumpMasterData($this->config, $data_layer, $this->io); $dump_master_data->dumpData($dump_data_filename); // Drop database connection. $data_layer::disconnect(); return 0; }