| @@ 38-61 (lines=24) @@ | ||
| 35 | ); |
|
| 36 | } |
|
| 37 | ||
| 38 | protected function execute(InputInterface $input, OutputInterface $output) |
|
| 39 | { |
|
| 40 | $io = new SymfonyStyle($input, $output); |
|
| 41 | if ($input->getOption('force')) { |
|
| 42 | $index = $this->getIndex($input->getOption(parent::INDEX_OPTION)); |
|
| 43 | ||
| 44 | $client = |
|
| 45 | ||
| 46 | $result = $index->dropIndex(); |
|
| 47 | ||
| 48 | $io->text( |
|
| 49 | sprintf( |
|
| 50 | 'The index <comment>`%s`</comment> was successfully dropped.', |
|
| 51 | $index->getIndexName() |
|
| 52 | ) |
|
| 53 | ); |
|
| 54 | } else { |
|
| 55 | $io->error('WARNING:'); |
|
| 56 | $io->text('This action should not be used in the production environment.'); |
|
| 57 | $io->error('Option --force is mandatory to drop the index.'); |
|
| 58 | } |
|
| 59 | ||
| 60 | return 0; |
|
| 61 | } |
|
| 62 | } |
|
| 63 | ||
| @@ 57-75 (lines=19) @@ | ||
| 54 | /** |
|
| 55 | * {@inheritdoc} |
|
| 56 | */ |
|
| 57 | protected function execute(InputInterface $input, OutputInterface $output) |
|
| 58 | { |
|
| 59 | $io = new SymfonyStyle($input, $output); |
|
| 60 | $index = $this->getIndex($input->getOption(parent::INDEX_OPTION)); |
|
| 61 | ||
| 62 | /** @var ExportService $exportService */ |
|
| 63 | $exportService = $this->getContainer()->get(ExportService::class); |
|
| 64 | $exportService->exportIndex( |
|
| 65 | $index, |
|
| 66 | $input->getArgument('filename'), |
|
| 67 | $input->getOption('chunk'), |
|
| 68 | $output, |
|
| 69 | $input->getOption('split') |
|
| 70 | ); |
|
| 71 | ||
| 72 | $io->success('Data export completed!'); |
|
| 73 | ||
| 74 | return 0; |
|
| 75 | } |
|
| 76 | } |
|
| 77 | ||