Returns every stored segment to pre-process for each site during cron archiving.
public static getKnownSegmentsToArchive ( ) : array | ||
리턴 | array | The list of stored segments that apply to all sites. |
/** * @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; }
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; }
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; }