public function getCacheControlDirective($name)
    {
        $value = null;

        switch ($name) {
            case 'public':
                $value = ($this->cacheDirectives['visibility'] === 'public' ? true : null);
            break;
            case 'private':
            case 'no-cache':
                preg_match('/^(' . $name . ')(?:="([^"]+)")?$/', $this->cacheDirectives['visibility'], $matches);
                if (!isset($matches[1])) {
                    $value = null;
                } else {
                    $value = (isset($matches[2]) ? $matches[2] : true);
                }
            break;
            case 'no-store':
            case 'no-transform':
            case 'must-revalidate':
            case 'proxy-revalidate':
                $value = ($this->cacheDirectives[$name] !== '' ? true : null);
            break;
            case 'max-age':
            case 's-maxage':
                preg_match('/^(' . $name . ')=(.+)$/', $this->cacheDirectives[$name], $matches);
                if (!isset($matches[1])) {
                    $value = null;
                } else {
                    $value = (isset($matches[2]) ? intval($matches[2]) : true);
                }
            break;
        }

        return $value;
    }
public function getCacheControlDirective($name)
    {
        $value = null;

        switch ($name) {
            case 'public':
                $value = ($this->cacheDirectives['visibility'] === 'public' ? true : null);
            break;
            case 'private':
            case 'no-cache':
                preg_match('/^(' . $name . ')(?:="([^"]+)")?$/', $this->cacheDirectives['visibility'], $matches);
                if (!isset($matches[1])) {
                    $value = null;
                } else {
                    $value = (isset($matches[2]) ? $matches[2] : true);
                }
            break;
            case 'no-store':
            case 'no-transform':
            case 'must-revalidate':
            case 'proxy-revalidate':
                $value = ($this->cacheDirectives[$name] !== '' ? true : null);
            break;
            case 'max-age':
            case 's-maxage':
                preg_match('/^(' . $name . ')=(.+)$/', $this->cacheDirectives[$name], $matches);
                if (!isset($matches[1])) {
                    $value = null;
                } else {
                    $value = (isset($matches[2]) ? intval($matches[2]) : true);
                }
            break;
        }

        return $value;
    }
public function getCacheControlDirective ( $ name ) { $ value = null ; switch ( $ name ) { case 'public' : $ value = ( $ this -> cacheDirectives [ 'visibility' ] === 'public' ? true : null ) ; break ; case 'private' : case 'no-cache' : preg_match ( '/^(' . $ name . ')(?:="([^"]+)")?$/' , $ this -> cacheDirectives [ 'visibility' ] , $ matches ) ; if ( ! isset ( $ matches [ 1 ] ) ) { $ value = null ; } else { $ value = ( isset ( $ matches [ 2 ] ) ? $ matches [ 2 ] : true ) ; } break ; case 'no-store' : case 'no-transform' : case 'must-revalidate' : case 'proxy-revalidate' : $ value = ( $ this -> cacheDirectives [ $ name ] !== '' ? true : null ) ; break ; case 'max-age' : case 's-maxage' : preg_match ( '/^(' . $ name . ')=(.+)$/' , $ this -> cacheDirectives [ $ name ] , $ matches ) ; if ( ! isset ( $ matches [ 1 ] ) ) { $ value = null ; } else { $ value = ( isset ( $ matches [ 2 ] ) ? intval ( $ matches [ 2 ] ) : true ) ; } break ; } return $ value ; }
Returns the value of the specified Cache-Control directive.

If the cache directive is not present, NULL is returned. If the specified
directive is present but contains no value, this method returns true. Finally,
if the directive is present and does contain a value, the value is returned.

@param string $name Name of the cache directive, for example "max-age"
@return mixed
@api
Returns the value of the specified Cache - Control directive .