Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.2.x will end 22 April 2024 (12 months).
  • Bug fixes for security issues in 4.2.x will end 7 October 2024 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.1.x is supported too.

SimplePie A PHP-Based RSS and Atom Feed Framework. Takes the hard work out of managing a complete RSS/Atom solution.

Author: Ryan Parman
Author: Sam Sneddon
Author: Ryan McCue
Copyright: 2004-2016 Ryan Parman, Sam Sneddon, Ryan McCue
License: http://www.opensource.org/licenses/bsd-license.php BSD License
File Size: 509 lines (15 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

Parser:: (18 methods):
  __construct()
  parse()
  has_data()
  is_linear_whitespace()
  http_version()
  status()
  reason()
  new_line()
  name()
  linear_whitespace()
  value()
  value_char()
  quote()
  quote_char()
  quote_escaped()
  body()
  chunked()
  prepareHeaders()


Class: Parser  - X-Ref

HTTP Response Parser

__construct($data)   X-Ref
Create an instance of the class with the input data

param: string $data Input data

parse()   X-Ref
Parse the input data

return: bool true on success, false on failure

has_data()   X-Ref
Check whether there is data beyond the pointer

return: bool true if there is further data, false if not

is_linear_whitespace()   X-Ref
See if the next character is LWS

return: bool true if the next character is LWS, false if not

http_version()   X-Ref
Parse the HTTP version


status()   X-Ref
Parse the status code


reason()   X-Ref
Parse the reason phrase


new_line()   X-Ref
Deal with a new line, shifting data around as needed


name()   X-Ref
Parse a header name


linear_whitespace()   X-Ref
Parse LWS, replacing consecutive LWS characters with a single space


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


value_char()   X-Ref
Parse a header value while outside quotes


quote()   X-Ref
See what state to move to while within quoted header values


quote_char()   X-Ref
Parse a header value while within quotes


quote_escaped()   X-Ref
Parse an escaped character within quotes


body()   X-Ref
Parse the body


chunked()   X-Ref
Parsed a "Transfer-Encoding: chunked" body


prepareHeaders($headers, $count = 1)   X-Ref
Prepare headers (take care of proxies headers)

param: string  $headers Raw headers
param: integer $count   Redirection count. Default to 1.
return: string