public static function getConfigurationFromPageId($pageId, $path, $initializeTsfe = false, $language = 0, $useTwoLevelCache = true)
    {
        $pageId = self::getConfigurationPageIdToUse($pageId);

        static $configurationObjectCache = [];
        $cacheId = md5($pageId . '|' . $path . '|' . $language . '|' . ($initializeTsfe ? '1' : '0'));
        if (isset($configurationObjectCache[$cacheId])) {
            return $configurationObjectCache[$cacheId];
        }

        // If we're on UID 0, we cannot retrieve a configuration currently.
        // getRootline() below throws an exception (since #typo3-60 )
        // as UID 0 cannot have any parent rootline by design.
        if ($pageId == 0) {
            return $configurationObjectCache[$cacheId] = self::buildTypoScriptConfigurationFromArray([], $pageId, $language, $path);
        }

        if ($useTwoLevelCache) {
            /** @var $cache TwoLevelCache */
            $cache = GeneralUtility::makeInstance(TwoLevelCache::class, /** @scrutinizer ignore-type */ 'tx_solr_configuration');
            $configurationArray = $cache->get($cacheId);
        }

        if (!empty($configurationArray)) {
            // we have a cache hit and can return it.
            return $configurationObjectCache[$cacheId] = self::buildTypoScriptConfigurationFromArray($configurationArray, $pageId, $language, $path);
        }

        // we have nothing in the cache. We need to build the configurationToUse
        $configurationArray = self::buildConfigurationArray($pageId, $path, $initializeTsfe, $language);

        if ($useTwoLevelCache && isset($cache)) {
            $cache->set($cacheId, $configurationArray);
        }

        return $configurationObjectCache[$cacheId] = self::buildTypoScriptConfigurationFromArray($configurationArray, $pageId, $language, $path);
    }
public static function getConfigurationFromPageId($pageId, $path, $initializeTsfe = false, $language = 0, $useTwoLevelCache = true)
    {
        $pageId = self::getConfigurationPageIdToUse($pageId);

        static $configurationObjectCache = [];
        $cacheId = md5($pageId . '|' . $path . '|' . $language . '|' . ($initializeTsfe ? '1' : '0'));
        if (isset($configurationObjectCache[$cacheId])) {
            return $configurationObjectCache[$cacheId];
        }

        // If we're on UID 0, we cannot retrieve a configuration currently.
        // getRootline() below throws an exception (since #typo3-60 )
        // as UID 0 cannot have any parent rootline by design.
        if ($pageId == 0) {
            return $configurationObjectCache[$cacheId] = self::buildTypoScriptConfigurationFromArray([], $pageId, $language, $path);
        }

        if ($useTwoLevelCache) {
            /** @var $cache TwoLevelCache */
            $cache = GeneralUtility::makeInstance(TwoLevelCache::class, /** @scrutinizer ignore-type */ 'tx_solr_configuration');
            $configurationArray = $cache->get($cacheId);
        }

        if (!empty($configurationArray)) {
            // we have a cache hit and can return it.
            return $configurationObjectCache[$cacheId] = self::buildTypoScriptConfigurationFromArray($configurationArray, $pageId, $language, $path);
        }

        // we have nothing in the cache. We need to build the configurationToUse
        $configurationArray = self::buildConfigurationArray($pageId, $path, $initializeTsfe, $language);

        if ($useTwoLevelCache && isset($cache)) {
            $cache->set($cacheId, $configurationArray);
        }

        return $configurationObjectCache[$cacheId] = self::buildTypoScriptConfigurationFromArray($configurationArray, $pageId, $language, $path);
    }
public static function getConfigurationFromPageId ( $ pageId , $ path , $ initializeTsfe = false , $ language = 0 , $ useTwoLevelCache = true ) { $ pageId = self :: getConfigurationPageIdToUse ( $ pageId ) ; static $ configurationObjectCache = [ ] ; $ cacheId = md5 ( $ pageId . '|' . $ path . '|' . $ language . '|' . ( $ initializeTsfe ? '1' : '0' ) ) ; if ( isset ( $ configurationObjectCache [ $ cacheId ] ) ) { return $ configurationObjectCache [ $ cacheId ] ; } // If we're on UID 0, we cannot retrieve a configuration currently. // getRootline() below throws an exception (since #typo3-60 ) // as UID 0 cannot have any parent rootline by design. if ( $ pageId == 0 ) { return $ configurationObjectCache [ $ cacheId ] = self :: buildTypoScriptConfigurationFromArray ( [ ] , $ pageId , $ language , $ path ) ; } if ( $ useTwoLevelCache ) { /** @var $cache TwoLevelCache */ $ cache = GeneralUtility :: makeInstance ( TwoLevelCache :: class , /** @scrutinizer ignore-type */ 'tx_solr_configuration' ) ; $ configurationArray = $ cache -> get ( $ cacheId ) ; } if ( ! empty ( $ configurationArray ) ) { // we have a cache hit and can return it. return $ configurationObjectCache [ $ cacheId ] = self :: buildTypoScriptConfigurationFromArray ( $ configurationArray , $ pageId , $ language , $ path ) ; } // we have nothing in the cache. We need to build the configurationToUse $ configurationArray = self :: buildConfigurationArray ( $ pageId , $ path , $ initializeTsfe , $ language ) ; if ( $ useTwoLevelCache && isset ( $ cache ) ) { $ cache -> set ( $ cacheId , $ configurationArray ) ; } return $ configurationObjectCache [ $ cacheId ] = self :: buildTypoScriptConfigurationFromArray ( $ configurationArray , $ pageId , $ language , $ path ) ; }
Loads the TypoScript configuration for a given page id and language.
Language usage may be disabled to get the default TypoScript
configuration.

@param int $pageId Id of the (root) page to get the Solr configuration from.
@param string $path The TypoScript configuration path to retrieve.
@param bool $initializeTsfe Optionally initializes a full TSFE to get the configuration, defaults to FALSE
@param int $language System language uid, optional, defaults to 0
@param bool $useTwoLevelCache Flag to enable the two level cache for the typoscript configuration array
@return TypoScriptConfiguration The Solr configuration for the requested tree.
Loads the TypoScript configuration for a given page id and language . Language usage may be disabled to get the default TypoScript configuration .