protected static function getTokenFromAuthorizationHeader()
    {
        $token = null;
        $authHeader = null;
        if ( function_exists( 'apache_request_headers' ) )
        {
            $apacheHeaders = apache_request_headers();
            if ( isset( $apacheHeaders[self::AUTH_HEADER_NAME] ) )
                $authHeader = $apacheHeaders[self::AUTH_HEADER_NAME];
        }
        else
        {
            if ( isset( $_SERVER[self::AUTH_CGI_HEADER_NAME] ) )
                $authHeader = $_SERVER[self::AUTH_CGI_HEADER_NAME];
        }

        if ( isset( $authHeader ) )
        {
            $tokenPattern = "/^(?P<authscheme>OAuth)\s(?P<token>[a-zA-Z0-9]+)$/";
            $match = preg_match( $tokenPattern, $authHeader, $m );
            if ( $match > 0 )
            {
                $token = $m['token'];
            }
        }


        return $token;
    }