Esempio n. 1
0
 /**
  * Purges all rootline caches.
  *
  * Note: This function is intended to be used in unit tests only.
  *
  * @return void
  */
 public static function purgeCaches()
 {
     self::$localCache = array();
     self::$pageRecordCache = array();
 }
 /**
  * Initialize a state to work with
  *
  * @throws \RuntimeException
  * @return void
  */
 protected function initializeObject()
 {
     $this->languageUid = intval($this->pageContext->sys_language_uid);
     $this->workspaceUid = intval($this->pageContext->versioningWorkspaceId);
     $this->versionPreview = $this->pageContext->versioningPreview;
     if ($this->mountPointParameter !== '') {
         if (!$GLOBALS['TYPO3_CONF_VARS']['FE']['enable_mount_pids']) {
             throw new \RuntimeException('Mount-Point Pages are disabled for this installation. Cannot resolve a Rootline for a page with Mount-Points', 1343462896);
         } else {
             $this->parseMountPointParameter();
         }
     }
     if (self::$cache === NULL) {
         self::$cache = $GLOBALS['typo3CacheManager']->getCache('cache_rootline');
     }
     self::$rootlineFields = array_merge(self::$rootlineFields, \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'], TRUE));
     array_unique(self::$rootlineFields);
 }