Example #1
0
 /**
  * @internal
  */
 public static function clearStaticCache()
 {
     self::$cache = null;
 }
Example #2
0
 private function getSiteIdsThatAreRequestedInThisArchiveButWereNotInvalidatedYet()
 {
     if (is_null(self::$cache)) {
         self::$cache = Cache::getTransientCache();
     }
     $id = 'Archive.SiteIdsOfRememberedReportsInvalidated';
     if (!self::$cache->contains($id)) {
         self::$cache->save($id, array());
     }
     $siteIdsAlreadyHandled = self::$cache->fetch($id);
     $siteIdsRequested = $this->params->getIdSites();
     foreach ($siteIdsRequested as $index => $siteIdRequested) {
         $siteIdRequested = (int) $siteIdRequested;
         if (in_array($siteIdRequested, $siteIdsAlreadyHandled)) {
             unset($siteIdsRequested[$index]);
             // was already handled previously, do not do it again
         } else {
             $siteIdsAlreadyHandled[] = $siteIdRequested;
             // we will handle this id this time
         }
     }
     self::$cache->save($id, $siteIdsAlreadyHandled);
     return $siteIdsRequested;
 }