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);
    }