public_html/piwik/core/Archive.php
/**
     * Gets the IDs of the archives we're querying for and stores them in $this->archives.
     * This function will launch the archiving process for each period/site/plugin if
     * metrics/reports have not been calculated/archived already.
     *
     * @param array $archiveGroups @see getArchiveGroupOfReport
     * @param array $plugins List of plugin names to archive.
     */
Gets the IDs of the archives we're querying for and stores them in $this->archives.
This function will launch the archiving process for each period/site/plugin if
metrics/reports have not been calculated/archived already.

@param array $archiveGroups @see getArchiveGroupOfReport
@param array $plugins List of plugin names to archive.
Gets the IDs of the archives we ' re querying for and stores them in $this - > archives . This function will launch the archiving process for each period / site / plugin if metrics / reports have not been calculated / archived already . @param array $archiveGroups @see getArchiveGroupOfReport @param array $plugins List of plugin names to archive .
private function cacheArchiveIdsAfterLaunching($archiveGroups, $plugins)
    {
        $this->invalidatedReportsIfNeeded();
        $today = Date::today();
        foreach ($this->params->getPeriods() as $period) {
            $twoDaysBeforePeriod = $period->getDateStart()->subDay(2);
            $twoDaysAfterPeriod = $period->getDateEnd()->addDay(2);
            foreach ($this->params->getIdSites() as $idSite) {
                $site = new Site($idSite);
                if ($twoDaysAfterPeriod->isEarlier($site->getCreationDate())) {
                    Log::debug("Archive site %s, %s (%s) skipped, archive is before the website was created.",
                        $idSite, $period->getLabel(), $period->getPrettyString());
                    continue;
                }
                if ($twoDaysBeforePeriod->isLater($today)) {
                    Log::debug("Archive site %s, %s (%s) skipped, archive is after today.",
                        $idSite, $period->getLabel(), $period->getPrettyString());
                    continue;
                }
                $this->prepareArchive($archiveGroups, $site, $period);
            }
        }
    }
private function cacheArchiveIdsAfterLaunching ( $ archiveGroups , $ plugins ) { $ this -> invalidatedReportsIfNeeded ( ) ; $ today = Date :: today ( ) ; foreach ( $ this -> params -> getPeriods ( ) as $ period ) { $ twoDaysBeforePeriod = $ period -> getDateStart ( ) -> subDay ( 2 ) ; $ twoDaysAfterPeriod = $ period -> getDateEnd ( ) -> addDay ( 2 ) ; foreach ( $ this -> params -> getIdSites ( ) as $ idSite ) { $ site = new Site ( $ idSite ) ; if ( $ twoDaysAfterPeriod -> isEarlier ( $ site -> getCreationDate ( ) ) ) { Log :: debug ( " Archive site %s, %s (%s) skipped, archive is before the website was created. " , $ idSite , $ period -> getLabel ( ) , $ period -> getPrettyString ( ) ) ; continue ; } if ( $ twoDaysBeforePeriod -> isLater ( $ today ) ) { Log :: debug ( " Archive site %s, %s (%s) skipped, archive is after today. " , $ idSite , $ period -> getLabel ( ) , $ period -> getPrettyString ( ) ) ; continue ; } $ this -> prepareArchive ( $ archiveGroups , $ site , $ period ) ; } } }
Gets the IDs of the archives we're querying for and stores them in $this->archives.
Gets the IDs of the archives we ' re querying for and stores them in $this - > archives .
// if the END of the period is BEFORE the website creation date // we already know there are no stats for this period // we add one day to make sure we don't miss the day of the website creation // if the starting date is in the future we know there is no visiidsite = ?t