PHP Class SimplePie_HTTP_Parser, ojs

Mostrar archivo Open project: pkp/ojs Class Usage Examples

Public Properties

Property Type Description
$body string Body of the response
$data string Input data
$data_length integer Input data length (to avoid calling strlen() every time this is needed)
$headers array Key/value pairs of the headers
$http_version float HTTP Version
$name string Name of the hedaer currently being parsed
$position integer Current position of the pointer
$reason string Reason phrase
$state string Current state of the state machine
$status_code integer Status code
$value string Value of the hedaer currently being parsed

Public Methods

Method Description
SimplePie_HTTP_Parser ( string $data ) Create an instance of the class with the input data
body ( ) Parse the body
has_data ( ) : boolean Check whether there is data beyond the pointer
http_version ( ) Parse the HTTP version
is_linear_whitespace ( ) : boolean 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
parse ( ) : boolean Parse the input data
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

Method Details

SimplePie_HTTP_Parser() public method

Create an instance of the class with the input data
public SimplePie_HTTP_Parser ( string $data )
$data string Input data

body() public method

Parse the body
public body ( )

has_data() public method

Check whether there is data beyond the pointer
public has_data ( ) : boolean
return boolean true if there is further data, false if not

http_version() public method

Parse the HTTP version
public http_version ( )

is_linear_whitespace() public method

See if the next character is LWS
public is_linear_whitespace ( ) : boolean
return boolean true if the next character is LWS, false if not

linear_whitespace() public method

Parse LWS, replacing consecutive LWS characters with a single space
public linear_whitespace ( )

name() public method

Parse a header name
public name ( )

new_line() public method

Deal with a new line, shifting data around as needed
public new_line ( )

parse() public method

Parse the input data
public parse ( ) : boolean
return boolean true on success, false on failure

quote() public method

See what state to move to while within quoted header values
public quote ( )

quote_char() public method

Parse a header value while within quotes
public quote_char ( )

quote_escaped() public method

Parse an escaped character within quotes
public quote_escaped ( )

reason() public method

Parse the reason phrase
public reason ( )

status() public method

Parse the status code
public status ( )

value() public method

See what state to move to while within non-quoted header values
public value ( )

value_char() public method

Parse a header value while outside quotes
public value_char ( )

Property Details

$body public_oe property

Body of the response
public string $body
return string

$data public_oe property

Input data
public string $data
return string

$data_length public_oe property

Input data length (to avoid calling strlen() every time this is needed)
public int $data_length
return integer

$headers public_oe property

Key/value pairs of the headers
public array $headers
return array

$http_version public_oe property

HTTP Version
public float $http_version
return float

$name public_oe property

Name of the hedaer currently being parsed
public string $name
return string

$position public_oe property

Current position of the pointer
public int $position
return integer

$reason public_oe property

Reason phrase
public string $reason
return string

$state public_oe property

Current state of the state machine
public string $state
return string

$status_code public_oe property

Status code
public int $status_code
return integer

$value public_oe property

Value of the hedaer currently being parsed
public string $value
return string