PHP Class Jonah_FeedParser, horde

Copyright 2000-2016 Horde LLC (http://www.horde.org/) This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Deprecation: Will be removed once the Aggregator app (Hippo) is started.
Author: Chuck Hagenbuch ([email protected])
Exibir arquivo Open project: horde/horde Class Usage Examples

Public Properties

Property Type Description
$channel array All the attributes of the channel description.
$charset string Feed charset.
$child string The current child tag - TITLE, DESCRIPTION, URL, etc.
$error string Error string.
$format string What kind of feed are we parsing?
$image array All the attributes of the channel image.
$item array All the attributes of the current item being parsed.
$parent string The current parent tag - CHANNEL, STORY, etc.
$parser resource XML parser resource.
$story array All the attributes of the current story being parsed.
$structure array The array that all the parsed information gets dumped into.

Public Methods

Method Description
Jonah_FeedParser ( $charset ) Constructs a new Jonah_FeedParser parser object.
characterData ( $parser, $data ) The handler for character data encountered in the XML file.
cleanup ( ) Clean up any existing data - reset to a state where we can cleanly open a new file.
defaultHandler ( $parser, $data ) Handles things that we don't recognize. A no-op.
endElement ( $parser, $name ) Handle the ends of XML elements - wrap up whatever we've been putting together and store it for safekeeping.
init ( ) Initialize the XML parser.
parse ( $data ) Actually do the parsing. Separated from the constructor just in case you want to set any other options on the parser, load initial data, whatever.
startElement ( $parser, $name, $attribs ) Start collecting data about a new element.

Method Details

Jonah_FeedParser() public method

Constructs a new Jonah_FeedParser parser object.
public Jonah_FeedParser ( $charset )

characterData() public method

The handler for character data encountered in the XML file.
public characterData ( $parser, $data )

cleanup() public method

Clean up any existing data - reset to a state where we can cleanly open a new file.
public cleanup ( )

defaultHandler() public method

Handles things that we don't recognize. A no-op.
public defaultHandler ( $parser, $data )

endElement() public method

Handle the ends of XML elements - wrap up whatever we've been putting together and store it for safekeeping.
public endElement ( $parser, $name )

init() public method

Initialize the XML parser.
public init ( )

parse() public method

Actually do the parsing. Separated from the constructor just in case you want to set any other options on the parser, load initial data, whatever.
public parse ( $data )
$data The XML feed data to parse.

startElement() public method

Start collecting data about a new element.
public startElement ( $parser, $name, $attribs )

Property Details

$channel public_oe property

All the attributes of the channel description.
public array $channel
return array

$charset public_oe property

Feed charset.
public string $charset
return string

$child public_oe property

The current child tag - TITLE, DESCRIPTION, URL, etc.
public string $child
return string

$error public_oe property

Error string.
public string $error
return string

$format public_oe property

What kind of feed are we parsing?
public string $format
return string

$image public_oe property

All the attributes of the channel image.
public array $image
return array

$item public_oe property

All the attributes of the current item being parsed.
public array $item
return array

$parent public_oe property

The current parent tag - CHANNEL, STORY, etc.
public string $parent
return string

$parser public_oe property

XML parser resource.
public resource $parser
return resource

$story public_oe property

All the attributes of the current story being parsed.
public array $story
return array

$structure public_oe property

The array that all the parsed information gets dumped into.
public array $structure
return array