Inheritance: extends Piwik\Plugin\API
Ejemplo n.º 1
0
 /**
  * Execute command like: ./console core:run-scheduled-tasks
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->forceRunAllTasksIfRequested($input);
     FrontController::getInstance()->init();
     API::getInstance()->runScheduledTasks();
     $this->writeSuccessMessage($output, array('Scheduled Tasks executed'));
 }
Ejemplo n.º 2
0
 /**
  * Execute command like: ./console core:run-scheduled-tasks
  */
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $this->forceRunAllTasksIfRequested($input);
     FrontController::getInstance()->init();
     $scheduledTasksResults = API::getInstance()->runScheduledTasks();
     foreach ($scheduledTasksResults as $scheduledTasksResult) {
         $output->writeln(sprintf('<comment>%s</comment> - %s', $scheduledTasksResult['task'], $scheduledTasksResult['output']));
     }
     $this->writeSuccessMessage($output, array('Scheduled Tasks executed'));
 }
Ejemplo n.º 3
0
 private function getApiToInvalidateArchivedReport()
 {
     if ($this->apiToInvalidateArchivedReport) {
         return $this->apiToInvalidateArchivedReport;
     }
     return CoreAdminHomeAPI::getInstance();
 }
Ejemplo n.º 4
0
 /**
  * @param $idSite
  */
 protected function setSiteIsArchived($idSite)
 {
     $websiteIdsInvalidated = APICoreAdminHome::getWebsiteIdsToInvalidate();
     if (count($websiteIdsInvalidated)) {
         $found = array_search($idSite, $websiteIdsInvalidated);
         if ($found !== false) {
             unset($websiteIdsInvalidated[$found]);
             Option::set(APICoreAdminHome::OPTION_INVALIDATED_IDSITES, serialize($websiteIdsInvalidated));
         }
     }
 }