Returns an array of acceptable content types in descending order of preference.

@param  string|null $default Default charset
@return array
506154
public function getAcceptableCharsets(?string $default = null): array
	{
		if(!isset($this->acceptableCharsets))
		{
			$this->acceptableCharsets = $this->parseAcceptHeader($this->get('accept-charset'));
		}

		return $this->acceptableCharsets ?: (array) $default;
	}
502066
public function getTypeConfig($type = self::NORMAL, $default = [])
    {
        if ($this->isTypeAvailable($type)) {
            return $this->pageTypesAvailable[$type];
        }

        return $default;
    }
173821
public function getCompressedExtensions( $default = null ) {

		$prop = $this->properties[ self::PROP_EXTENSION_COMPRESSED ];

		if( isset( $prop ) && strlen( $prop ) > 0 ) {

			return preg_split( "/,/", $prop );
		}

		return $default;
	}
1148765
protected function getBestLanguage(Request $request, $default = null)
    {
        foreach ($request->getLanguages() as $language) {
            if (strpos($language, '_') !== false) {
                return $language;
            }
        }

        return $default;
    }
737218
private function getLanguages($forcedLanguage = null, $fallbackLanguage = null)
    {
        if ($forcedLanguage !== null) {
            $languages = array($forcedLanguage);
        } else {
            $languages = $this->configResolver->getParameter('languages');
        }

        // Always add $fallbackLanguage, even if null, as last entry so that we can fallback to
        // main/initial language if domain supports it.
        $languages[] = $fallbackLanguage;

        return $languages;
    }
1136222
public function getLanguageUid(int $default = null): int {
    $languageUid = $default ?: 0;

    if (TYPO3_MODE === 'FE') {
      if (isset($GLOBALS['TSFE']->sys_language_uid)) {
        $languageUid = $GLOBALS['TSFE']->sys_language_uid;
      }
    } elseif (is_object($GLOBALS['LANG'])) {
      if (isset($GLOBALS['LANG']->sys_language_uid)) {
        $languageUid = $GLOBALS['LANG']->sys_language_uid;
      }
    }

    return $languageUid;
  }
1205185
protected function _defaultData($content)
    {
        $content = @unserialize($content);
        if (empty($content) || !is_a($content, \stdClass::class)) {
            $content = new \stdClass;
        }
        $content->text = isset($content->text) ? $content->text : '';
        $content->colour = isset($content->colour) ? $content->colour : '';
        return $content;
    }
540625
protected function getPreferredLanguage($default='en-US')
    {
        $acceptedLanguages = $this->getServerCollection()->get('HTTP_ACCEPT_LANGUAGE');

        // regex inspired from @GabrielAnderson on http://stackoverflow.com/questions/6038236/http-accept-language
        preg_match_all('/([a-z]{1,8}(-[a-z]{1,8})*)\s*(;\s*q\s*=\s*(1|0\.[0-9]+))?/i', $acceptedLanguages, $lang_parse);
        $langs = $lang_parse[1];
        $ranks = $lang_parse[4];

        // (create an associative array 'language' => 'preference')
        $lang2pref = array();
        for($i=0; $i<count($langs); $i++) {
            $lang2pref[$langs[$i]] = (float) (!empty($ranks[$i]) ? $ranks[$i] : 1);
        }

        // (comparison function for uksort)
        $cmpLangs = function ($a, $b) use ($lang2pref) {
            if ($lang2pref[$a] > $lang2pref[$b])
                return -1;
            elseif ($lang2pref[$a] < $lang2pref[$b])
                return 1;
            elseif (strlen($a) > strlen($b))
                return -1;
            elseif (strlen($a) < strlen($b))
                return 1;
            else
                return 0;
        };

        // sort the languages by prefered language and by the most specific region
        uksort($lang2pref, $cmpLangs);

        $tokens = array_keys($lang2pref);
        $current = array_shift($tokens);
        
        if (strlen($current) !== strlen($default)) {
            return ($default !== null) ? $default : $current;
        }
        
        return $current;
    }
962288
public function getCharsets()
    {
        if (null !== $this->charsets) {
            return $this->charsets;
        }

        $charsets = $this->headers->getParameterListAsObject('Accept-Charset');

        return $this->charsets = $charsets->getParameterKeys();
    }
681050
public function get($language = null, $default = null)
    {
        if ($language === null) {
            $language = 'default';
        }

        $data = parent::get($language, null);

        if ($data === null) {
            $data = $this->get('default', $default);
        }

        return $data;
    }
480368
public function getDocumentExtensions( $default = null ) {

		$prop = $this->properties[ self::PROP_EXTENSION_DOCUMENT ];

		if( isset( $prop ) && strlen( $prop ) > 0 ) {

			return preg_split( "/,/", $prop );
		}

		return $default;
	}
840032
public function getAcceptedContentTypes()
    {
        if (empty($this->acceptedContentTypes)) {
            // Values will be stored in this array
            $this->acceptedContentTypes = array();

            // Accept header is case insensitive, and whitespace isn’t important.
            $acceptHeader = strtolower(str_replace(' ', '', @$_SERVER['HTTP_ACCEPT'] ?: '*/*'));
            // Extract the content types from the header.
            $acceptHeaderItems = explode(',', $acceptHeader);
            foreach ($acceptHeaderItems as $contentType) {
                // The default quality is 1.
                $quality = 1;
                // Check whether a quality is specified.
                if (strpos($contentType, ';q=')) {
                    list($contentType, $quality) = explode(';q=', $contentType);
                }

                $this->acceptedContentTypes[$contentType] = $quality;
            }
            // Sort the content types by relevance.
            arsort($this->acceptedContentTypes);
        }

        return $this->acceptedContentTypes;
    }
247634
public static function get($key = null, $default = null)
    {
        // 无参数时获取所有
        if (empty($key)) {
            return self::$_content;
        }

        $key = strtolower($key);
        return Cml::doteToArr($key, self::$_content['normal'], $default);
    }
939027
public static function getDefault($domain = null)
    {
        // Get by domain if it exists and has a default
        $domainObject = Domain::getByDomain($domain);
        if ($domainObject) {
            $default = $domainObject->DefaultLocale();
            if ($default) {
                return $default;
            }
        }

        // Get explicit or implicit default
        $locales = static::getLocales();
        return $locales->filter('IsGlobalDefault', 1)->first()
            ?: $locales->first();
    }
705842
public function getListLimit($default = 0)
    {

        $limit = $this->getState("limit", intval($default));

        //print_R( $this->config->get("content.lists.length"));

        $limit = empty($limit) ? $this->config->get("content.lists.length", 20) : $limit;

        return $limit;
    }
1286342
public function get($name, $default = null)
	{
		if ( substr($name, -1) == '.' ) {
			$ret = array();

			foreach ( $this->settings as $setting_name => $setting_value ) {
				if ( preg_match('/^' . preg_quote($name, '/') . '/', $setting_name) ) {
					$ret[$setting_name] = $setting_value;
				}
			}

			return $ret;
		}

		return array_key_exists($name, $this->settings) ? $this->settings[$name] : $default;
	}
1207700
private static function getDefaults()
    {
        return [
            self::OPTION_ENDPOINT           => null,
            self::OPTION_HOST               => null,
            self::OPTION_PORT               => DefaultValues::DEFAULT_PORT,
            self::OPTION_TIMEOUT            => DefaultValues::DEFAULT_TIMEOUT,
            self::OPTION_CREATE             => DefaultValues::DEFAULT_CREATE,
            self::OPTION_UPDATE_POLICY      => DefaultValues::DEFAULT_UPDATE_POLICY,
            self::OPTION_REPLACE_POLICY     => DefaultValues::DEFAULT_REPLACE_POLICY,
            self::OPTION_DELETE_POLICY      => DefaultValues::DEFAULT_DELETE_POLICY,
            self::OPTION_REVISION           => null,
            self::OPTION_WAIT_SYNC          => DefaultValues::DEFAULT_WAIT_SYNC,
            self::OPTION_BATCHSIZE          => null,
            self::OPTION_JOURNAL_SIZE       => DefaultValues::DEFAULT_JOURNAL_SIZE,
            self::OPTION_IS_SYSTEM          => false,
            self::OPTION_IS_VOLATILE        => DefaultValues::DEFAULT_IS_VOLATILE,
            self::OPTION_CLIENT             => DefaultValues::DEFAULT_CLIENT,
            self::OPTION_TRACE              => null,
            self::OPTION_ENHANCED_TRACE     => false,
            self::OPTION_AUTH_USER          => null,
            self::OPTION_AUTH_PASSWD        => null,
            self::OPTION_AUTH_TYPE          => null,
            self::OPTION_RECONNECT          => false,
            self::OPTION_BATCH              => false,
            self::OPTION_BATCHPART          => false,
            self::OPTION_CHECK_UTF8_CONFORM => DefaultValues::DEFAULT_CHECK_UTF8_CONFORM,
        ];
    }