getKnownSegmentsToArchive() public static méthode

Returns every stored segment to pre-process for each site during cron archiving.
public static getKnownSegmentsToArchive ( ) : array
Résultat array The list of stored segments that apply to all sites.
Exemple #1
0
 /**
  * @param $idSites
  * @return array
  */
 private static function getSegmentsToProcess($idSites)
 {
     $knownSegmentsToArchiveAllSites = SettingsPiwik::getKnownSegmentsToArchive();
     $segmentsToProcess = $knownSegmentsToArchiveAllSites;
     foreach ($idSites as $idSite) {
         $segmentForThisWebsite = SettingsPiwik::getKnownSegmentsToArchiveForSite($idSite);
         $segmentsToProcess = array_merge($segmentsToProcess, $segmentForThisWebsite);
     }
     $segmentsToProcess = array_unique($segmentsToProcess);
     return $segmentsToProcess;
 }
Exemple #2
0
 public static function shouldProcessReportsAllPlugins(Segment $segment, $periodLabel)
 {
     if ($segment->isEmpty() && $periodLabel != 'range') {
         return true;
     }
     $segmentsToProcess = SettingsPiwik::getKnownSegmentsToArchive();
     if (!empty($segmentsToProcess)) {
         // If the requested segment is one of the segments to pre-process
         // we ensure that any call to the API will trigger archiving of all reports for this segment
         $segment = $segment->getString();
         if (in_array($segment, $segmentsToProcess)) {
             return true;
         }
     }
     return false;
 }
Exemple #3
0
 private function initSegmentsToArchive()
 {
     $segments = \Piwik\SettingsPiwik::getKnownSegmentsToArchive();
     if (empty($segments)) {
         return array();
     }
     $this->logger->info("- Will pre-process " . count($segments) . " Segments for each website and each period: " . implode(", ", $segments));
     return $segments;
 }