예제 #1
0
 /**
  * Sets the entry to cache.
  *
  * @param UrlCacheEntry $cacheEntry
  * @return void
  */
 public function putUrlToCache(UrlCacheEntry $cacheEntry)
 {
     $data = array('original_url' => $cacheEntry->getOriginalUrl(), 'page_id' => $cacheEntry->getPageId(), 'request_variables' => json_encode($cacheEntry->getRequestVariables()), 'rootpage_id' => $cacheEntry->getRootPageId(), 'speaking_url' => $cacheEntry->getSpeakingUrl(), 'tstamp' => time());
     if ($cacheEntry->getCacheId()) {
         $this->databaseConnection->exec_UPDATEquery('tx_realurl_urlcache', 'cache_id=' . $this->databaseConnection->fullQuoteStr($cacheEntry->getCacheId(), 'tx_realurl_urlcache'), $data);
     } else {
         $data['crdate'] = $data['tstamp'];
         $this->databaseConnection->exec_INSERTquery('tx_realurl_urlcache', $data);
         $cacheEntry->setCacheId($this->databaseConnection->sql_insert_id());
     }
 }
예제 #2
0
 /**
  * Sets variables after the decoding.
  *
  * @param UrlCacheEntry $cacheEntry
  */
 protected function setRequestVariables(UrlCacheEntry $cacheEntry)
 {
     if ($cacheEntry) {
         $requestVariables = $cacheEntry->getRequestVariables();
         $this->restoreIgnoredUrlParameters($requestVariables);
         $requestVariables['id'] = $cacheEntry->getPageId();
         $_SERVER['QUERY_STRING'] = $this->createQueryStringFromParameters($requestVariables);
         // Setting info in TSFE
         $this->caller->mergingWithGetVars($this->makeRealPhpArrayFromRequestVars($requestVariables));
         $this->caller->id = $cacheEntry->getPageId();
         if ($this->mimeType) {
             header('Content-type: ' . $this->mimeType);
             $this->mimeType = null;
         }
     }
 }
예제 #3
0
 /**
  * Sets the entry to cache.
  *
  * @param UrlCacheEntry $cacheEntry
  * @return void
  */
 public function putUrlToCache(UrlCacheEntry $cacheEntry)
 {
     $data = array('expire' => $cacheEntry->getExpiration(), 'original_url' => $cacheEntry->getOriginalUrl(), 'page_id' => $cacheEntry->getPageId(), 'request_variables' => json_encode($cacheEntry->getRequestVariables()), 'rootpage_id' => $cacheEntry->getRootPageId(), 'speaking_url' => $cacheEntry->getSpeakingUrl());
     if ($cacheEntry->getCacheId()) {
         $this->databaseConnection->exec_UPDATEquery('tx_realurl_urldata', 'uid=' . $this->databaseConnection->fullQuoteStr($cacheEntry->getCacheId(), 'tx_realurl_urldata'), $data);
     } else {
         $this->databaseConnection->sql_query('START TRANSACTION');
         if ($this->limitTableRecords('tx_realurl_urldata')) {
             $this->databaseConnection->sql_query('DELETE FROM tx_realurl_uniqalias_cache_map WHERE url_cache_id NOT IN (SELECT uid FROM tx_realurl_urldata)');
         }
         $this->databaseConnection->exec_INSERTquery('tx_realurl_urldata', $data);
         $cacheEntry->setCacheId($this->databaseConnection->sql_insert_id());
         $this->databaseConnection->sql_query('COMMIT');
     }
 }