protected function execute(InputInterface $input, OutputInterface $output)
 {
     $minutes = (int) $input->getOption('minutes');
     if ($minutes < 1) {
         throw new \InvalidArgumentException('Minutes has to be a positive number');
     }
     if ($input->getOption('all')) {
         $feeds = $this->getAllFeeds();
     } elseif ($ids = $input->getOption('feed')) {
         $feeds = $this->getFeeds($ids);
     } else {
         $feeds = $this->getScheduledFeeds($minutes);
     }
     if (empty($feeds)) {
         $output->writeln('No feeds to schedule');
         return 0;
     }
     // pipe import manager log to console
     $this->importManager->getLogger()->getLogger()->pushHandler(new ConsoleHandler($output));
     if ($output->getVerbosity() >= OutputInterface::VERBOSITY_NORMAL) {
         $this->setDownloadListeners($output, $this->importManager->getEventDispatcher());
     }
     $force = $input->getOption('force');
     return $this->scheduleImports($output, $feeds, $minutes, $force);
 }
Пример #2
0
 /**
  * @inheritdoc
  */
 public function getLogger()
 {
     return $this->importManager->getLogger()->getLogger();
 }
 /**
  * @param Import $import
  */
 protected function removeLog(Import $import)
 {
     $this->importManager->getLogger()->removeImportLog($import);
 }