Source for file rss.php
Documentation is available at rss.php
* @package Joomla.Platform
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE
* @package Joomla.Platform
* @link http://cyber.law.harvard.edu/rss/rss.html
* @var string The feed element name for the entry elements.
* @var string The feed format version.
* Method to handle the <category> element for the feed.
* @param JFeed $feed The JFeed object being built from the parsed feed.
* @param SimpleXMLElement $el The current XML element object to handle.
// Get the data from the element.
$domain = (string)
$el['domain'];
$category = (string)
$el;
$feed->addCategory($category, $domain);
* Method to handle the <cloud> element for the feed.
* @param JFeed $feed The JFeed object being built from the parsed feed.
* @param SimpleXMLElement $el The current XML element object to handle.
protected function handleCloud(JFeed $feed, SimpleXMLElement $el)
$cloud->domain = (string)
$el['domain'];
$cloud->port = (string)
$el['port'];
$cloud->path = (string)
$el['path'];
$cloud->protocol = (string)
$el['protocol'];
$cloud->registerProcedure = (string)
$el['registerProcedure'];
* Method to handle the <copyright> element for the feed.
* @param JFeed $feed The JFeed object being built from the parsed feed.
* @param SimpleXMLElement $el The current XML element object to handle.
$feed->copyright = (string)
$el;
* Method to handle the <description> element for the feed.
* @param JFeed $feed The JFeed object being built from the parsed feed.
* @param SimpleXMLElement $el The current XML element object to handle.
$feed->description = (string)
$el;
* Method to handle the <generator> element for the feed.
* @param JFeed $feed The JFeed object being built from the parsed feed.
* @param SimpleXMLElement $el The current XML element object to handle.
$feed->generator = (string)
$el;
* Method to handle the <image> element for the feed.
* @param JFeed $feed The JFeed object being built from the parsed feed.
* @param SimpleXMLElement $el The current XML element object to handle.
protected function handleImage(JFeed $feed, SimpleXMLElement $el)
// Create a feed link object for the image.
// Populate extra fields if they exist.
$image->link = (string)
$el->link;
$image->description = (string)
$el->description;
$image->height = (string)
$el->height;
$image->width = (string)
$el->width;
* Method to handle the <language> element for the feed.
* @param JFeed $feed The JFeed object being built from the parsed feed.
* @param SimpleXMLElement $el The current XML element object to handle.
$feed->language = (string)
$el;
* Method to handle the <lastBuildDate> element for the feed.
* @param JFeed $feed The JFeed object being built from the parsed feed.
* @param SimpleXMLElement $el The current XML element object to handle.
$feed->updatedDate = (string)
$el;
* Method to handle the <link> element for the feed.
* @param JFeed $feed The JFeed object being built from the parsed feed.
* @param SimpleXMLElement $el The current XML element object to handle.
protected function handleLink(JFeed $feed, SimpleXMLElement $el)
$link->uri = (string)
$el['href'];
* Method to handle the <managingEditor> element for the feed.
* @param JFeed $feed The JFeed object being built from the parsed feed.
* @param SimpleXMLElement $el The current XML element object to handle.
* Method to handle the <skipDays> element for the feed.
* @param JFeed $feed The JFeed object being built from the parsed feed.
* @param SimpleXMLElement $el The current XML element object to handle.
// Add all of the day values from the feed to the array.
foreach ($el->day as $day)
* Method to handle the <skipHours> element for the feed.
* @param JFeed $feed The JFeed object being built from the parsed feed.
* @param SimpleXMLElement $el The current XML element object to handle.
// Add all of the day values from the feed to the array.
foreach ($el->hour as $hour)
$feed->skipHours =
$hours;
* Method to handle the <pubDate> element for the feed.
* @param JFeed $feed The JFeed object being built from the parsed feed.
* @param SimpleXMLElement $el The current XML element object to handle.
protected function handlePubDate(JFeed $feed, SimpleXMLElement $el)
$feed->publishedDate = (string)
$el;
* Method to handle the <title> element for the feed.
* @param JFeed $feed The JFeed object being built from the parsed feed.
* @param SimpleXMLElement $el The current XML element object to handle.
protected function handleTitle(JFeed $feed, SimpleXMLElement $el)
$feed->title = (string)
$el;
* Method to handle the <ttl> element for the feed.
* @param JFeed $feed The JFeed object being built from the parsed feed.
* @param SimpleXMLElement $el The current XML element object to handle.
protected function handleTtl(JFeed $feed, SimpleXMLElement $el)
$feed->ttl = (integer)
$el;
* Method to handle the <webmaster> element for the feed.
* @param JFeed $feed The JFeed object being built from the parsed feed.
* @param SimpleXMLElement $el The current XML element object to handle.
// Get the tag contents and split it over the first space.
// This is really cheap parsing. Probably need to create a method to do this more robustly.
$name =
trim($tmp[1], ' ()');
$feed->addContributor($name, $email, null, 'webmaster');
* Method to initialise the feed for parsing. Here we detect the version and advance the stream
* reader so that it is ready to parse feed elements.
// Read the version attribute.
// We want to move forward to the first element after the <channel> element.
* Method to handle the feed entry element for the feed: <item>.
* @param JFeedEntry $entry The JFeedEntry object being built from the parsed feed entry.
* @param SimpleXMLElement $el The current XML element object to handle.
$entry->uri = (string)
$el->link;
$entry->title = (string)
$el->title;
$entry->publishedDate = (string)
$el->pubDate;
$entry->updatedDate = (string)
$el->pubDate;
$entry->content = (string)
$el->description;
$entry->guid = (string)
$el->guid;
$entry->comments = (string)
$el->comments;
// Add the feed entry author if available.
$author = (string)
$el->author;
// Add any categories to the entry.
foreach ($el->category as $category)
$entry->addCategory((string)
$category, (string)
$category['domain']);
// Add any enclosures to the entry.
foreach ($el->enclosure as $enclosure)
(string)
$enclosure['url'],
(string)
$enclosure['type'],
(int)
$enclosure['length']
* Method to parse a string with person data and return a JFeedPerson object.
* @param string $data The string to parse for a person.
// Create a new person object.
// This is really cheap parsing, but so far good enough. :)
$person->name =
trim($data[1], ' ()');
// Set the email for the person.
$person->email =
trim($data[0]);
Documentation generated on Tue, 19 Nov 2013 15:12:29 +0100 by phpDocumentor 1.4.3