Neos\Flow\Http\Headers::setCacheControlDirectivesFromRawHeader PHP Method

setCacheControlDirectivesFromRawHeader() protected method

Internally sets the cache directives correctly by parsing the given Cache-Control field value.
See also: set()
protected setCacheControlDirectivesFromRawHeader ( string $rawFieldValue ) : void
$rawFieldValue string The value of a specification compliant Cache-Control header
return void
    protected function setCacheControlDirectivesFromRawHeader($rawFieldValue)
    {
        foreach (array_keys($this->cacheDirectives) as $key) {
            $this->cacheDirectives[$key] = '';
        }
        preg_match_all('/([a-zA-Z][a-zA-Z_-]*)\\s*(?:=\\s*(?:"([^"]*)"|([^,;\\s"]*)))?/', $rawFieldValue, $matches, PREG_SET_ORDER);
        foreach ($matches as $match) {
            if (isset($match[2]) && $match[2] !== '') {
                $value = $match[2];
            } elseif (isset($match[3]) && $match[3] !== '') {
                $value = $match[3];
            } else {
                $value = null;
            }
            $this->setCacheControlDirective(strtolower($match[1]), $value);
        }
    }