public static function accept($type = null)
    {
        if (! isset(self::$_accept) && isset($_SERVER['HTTP_ACCEPT'])) {
            $accept = AnRequest::get('server.HTTP_ACCEPT', 'string');
            self::$_accept['format'] = self::_parseAccept($accept);

            if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) {
                $accept = AnRequest::get('server.HTTP_ACCEPT_ENCODING', 'string');
                self::$_accept['encoding'] = self::_parseAccept($accept);
            }

            if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
                $accept = AnRequest::get('server.HTTP_ACCEPT_LANGUAGE', 'string');
                self::$_accept['language'] = self::_parseAccept($accept);
            }
        }

        return $type ? self::$_accept[$type] : self::$_accept;
    }
public static function accept($type = null)
    {
        if (! isset(self::$_accept) && isset($_SERVER['HTTP_ACCEPT'])) {
            $accept = AnRequest::get('server.HTTP_ACCEPT', 'string');
            self::$_accept['format'] = self::_parseAccept($accept);

            if (isset($_SERVER['HTTP_ACCEPT_ENCODING'])) {
                $accept = AnRequest::get('server.HTTP_ACCEPT_ENCODING', 'string');
                self::$_accept['encoding'] = self::_parseAccept($accept);
            }

            if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
                $accept = AnRequest::get('server.HTTP_ACCEPT_LANGUAGE', 'string');
                self::$_accept['language'] = self::_parseAccept($accept);
            }
        }

        return $type ? self::$_accept[$type] : self::$_accept;
    }
public static function accept ( $ type = null ) { if ( ! isset ( self :: $ _accept ) && isset ( $ _SERVER [ 'HTTP_ACCEPT' ] ) ) { $ accept = AnRequest :: get ( 'server.HTTP_ACCEPT' , 'string' ) ; self :: $ _accept [ 'format' ] = self :: _parseAccept ( $ accept ) ; if ( isset ( $ _SERVER [ 'HTTP_ACCEPT_ENCODING' ] ) ) { $ accept = AnRequest :: get ( 'server.HTTP_ACCEPT_ENCODING' , 'string' ) ; self :: $ _accept [ 'encoding' ] = self :: _parseAccept ( $ accept ) ; } if ( isset ( $ _SERVER [ 'HTTP_ACCEPT_LANGUAGE' ] ) ) { $ accept = AnRequest :: get ( 'server.HTTP_ACCEPT_LANGUAGE' , 'string' ) ; self :: $ _accept [ 'language' ] = self :: _parseAccept ( $ accept ) ; } } return $ type ? self :: $ _accept [ $ type ] : self :: $ _accept ; }
Get the accept request information

@param   string  The accept data to return. Can be 'format', 'encoding' or 'language'.
If not set, all the accept data will be returned.
@return  array   An associative array with the content data. Valid keys are
'format', 'encoding' and 'language'
Get the accept request information