protected function execute(InputInterface $input, OutputInterface $output)
 {
     $translation = $input->getArgument('translation');
     if ($translation === null) {
         $this->translationTable($output, $this->allTranslations());
         $output->writeln("<info>Please specify a </info><comment>translation ID</comment><info>. You can refer to the table above.</info>\n");
     } else {
         $this->config->customTranslations($translation);
         // dump($this->config->get('translations'));
         $dw = new Downloader($this->config);
         $dw->sync();
         $output->writeln("<info>{$translation}</info> has been added successfully.\n");
     }
 }
 public function initialize()
 {
     // If original quran not exist in storage_path, copy one
     $quran_source = realpath(__DIR__ . '/../../../data/ar.quran.xml');
     $quran_dest = $this->config->get('storage_path') . '/ar.quran.xml';
     $meta_source = realpath(__DIR__ . '/../../../data/quran-data.xml');
     $meta_dest = $this->config->get('storage_path') . '/quran-data.xml';
     // If storage path didn't exist, create it
     if (!file_exists($this->config->get('storage_path'))) {
         mkdir($this->config->get('storage_path'));
     }
     // Copy quran
     if (!file_exists($quran_dest)) {
         copy($quran_source, $quran_dest);
     }
     // Copy metadata
     if (!file_exists($meta_dest)) {
         copy($meta_source, $meta_dest);
     }
     // Sync translation files to storage path
     $dw = new Downloader($this->config);
     $dw->sync();
 }