\SimplePie_HTTP_Parser
HTTP Response Parser
Synopsis
class SimplePie_HTTP_Parser
{
- // members
- public float $http_version = 0.0;
- public integer $status_code = 0;
- public string $reason = '';
- public array $headers = ;
- public string $body = '';
- protected string $state = 'http_version';
- protected string $data = '';
- protected integer $data_length = 0;
- protected integer $position = 0;
- protected string $name = '';
- protected string $value = '';
- // methods
- public void __construct()
- public bool parse()
- protected bool has_data()
- protected bool is_linear_whitespace()
- protected void http_version()
- protected void status()
- protected void reason()
- protected void new_line()
- protected void name()
- protected void linear_whitespace()
- protected void value()
- protected void value_char()
- protected void quote()
- protected void quote_char()
- protected void quote_escaped()
- protected void body()
- protected void chunked()
Members
protected
- $data
—
string
Input data - $data_length
—
int
Input data length (to avoid calling strlen() everytime this is needed) - $name
—
string
Name of the hedaer currently being parsed - $position
—
int
Current position of the pointer - $state
—
string
Current state of the state machine - $value
—
string
Value of the hedaer currently being parsed
public
- $body
—
string
Body of the response - $headers
—
array
Key/value pairs of the headers - $http_version
—
float
HTTP Version - $reason
—
string
Reason phrase - $status_code
—
int
Status code
Methods
protected
- body() — Parse the body
- chunked() — Parsed a "Transfer-Encoding: chunked" body
- has_data() — Check whether there is data beyond the pointer
- http_version() — Parse the HTTP version
- is_linear_whitespace() — See if the next character is LWS
- linear_whitespace() — Parse LWS, replacing consecutive LWS characters with a single space
- name() — Parse a header name
- new_line() — Deal with a new line, shifting data around as needed
- quote() — See what state to move to while within quoted header values
- quote_char() — Parse a header value while within quotes
- quote_escaped() — Parse an escaped character within quotes
- reason() — Parse the reason phrase
- status() — Parse the status code
- value() — See what state to move to while within non-quoted header values
- value_char() — Parse a header value while outside quotes
public
- __construct() — Create an instance of the class with the input data
- parse() — Parse the input data