cvs: pear /XML_Feed_Parser/Parser Atom.php AtomElement.php

From: Date: Sat, 12 Nov 2005 15:00:36 +0000
Subject: cvs: pear /XML_Feed_Parser/Parser Atom.php AtomElement.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-36238@lists.php.net to get a copy of this message
jystewart Sat Nov 12 10:00:36 2005 EDT Modified files: /pear/XML_Feed_Parser/Parser Atom.php AtomElement.php Log: Changing the way parameters are handled for the atom person construct Adding mapping of 'links' to 'link' for universal feed parser compatibility http://cvs.php.net/diff.php/pear/XML_Feed_Parser/Parser/Atom.php?r1=1.8&r2=1.9&ty=u Index: pear/XML_Feed_Parser/Parser/Atom.php diff -u pear/XML_Feed_Parser/Parser/Atom.php:1.8 pear/XML_Feed_Parser/Parser/Atom.php:1.9 --- pear/XML_Feed_Parser/Parser/Atom.php:1.8 Sat Nov 12 09:26:10 2005 +++ pear/XML_Feed_Parser/Parser/Atom.php Sat Nov 12 10:00:34 2005 @@ -17,7 +17,7 @@ * @author James Stewart <james@jystewart.net> * @copyright 2005 James Stewart <james@jystewart.net> * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL 2.1 - * @version CVS: $Id: Atom.php,v 1.8 2005/11/12 14:26:10 jystewart Exp $ + * @version CVS: $Id: Atom.php,v 1.9 2005/11/12 15:00:34 jystewart Exp $ * @link http://pear.php.net/package/XML_Feed_Parser/ */ @@ -98,7 +98,8 @@ * needed to make the mapping. * @var array */ - protected $compatMap = array(); + protected $compatMap = array( + 'links' => array('link')); /** * Our constructor does nothing more than its parent. @@ -157,16 +158,13 @@ protected function getPerson($method, $arguments) { $offset = empty($arguments[0]) ? 0 : $arguments[0]; - $arguments = empty($arguments[1]) ? array() : $arguments[1]; + $parameter = empty($arguments[1]) ? 'name' : $arguments[1]; $section = $this->model->getElementsByTagName($method); + print $section->length . ':' . $offset . "\n"; if ($section->length == 0 or $section->length < $offset+1) { return false; } - if (isset($arguments['param'])) { - $parameter = $arguments['param']; - } else { - $parameter = 'name'; - } + $param = $section->item($offset)->getElementsByTagName($parameter); if ($param->length == 0) { return false; http://cvs.php.net/diff.php/pear/XML_Feed_Parser/Parser/AtomElement.php?r1=1.7&r2=1.8&ty=u Index: pear/XML_Feed_Parser/Parser/AtomElement.php diff -u pear/XML_Feed_Parser/Parser/AtomElement.php:1.7 pear/XML_Feed_Parser/Parser/AtomElement.php:1.8 --- pear/XML_Feed_Parser/Parser/AtomElement.php:1.7 Sat Nov 12 09:26:10 2005 +++ pear/XML_Feed_Parser/Parser/AtomElement.php Sat Nov 12 10:00:34 2005 @@ -17,7 +17,7 @@ * @author James Stewart <james@jystewart.net> * @copyright 2005 James Stewart <james@jystewart.net> * @license http://www.gnu.org/copyleft/lesser.html GNU LGPL 2.1 - * @version CVS: $Id: AtomElement.php,v 1.7 2005/11/12 14:26:10 jystewart Exp $ + * @version CVS: $Id: AtomElement.php,v 1.8 2005/11/12 15:00:34 jystewart Exp $ * @link http://pear.php.net/package/XML_Feed_Parser/ */ @@ -52,12 +52,14 @@ /** * Here we provide a few mappings for those very special circumstances in - * which it makes sense to map back to the RSS2 spec. Key is RSS2 version - * value is an array consisting of the equivalent in atom and any attributes - * needed to make the mapping. + * which it makes sense to map back to the RSS2 spec or to manage other + * compatibilities (eg. with the Univeral Feed Parser). Key is the other version's + * name for the command, value is an array consisting of the equivalent in our atom + * api and any attributes needed to make the mapping. * @var array */ - protected $compatMap = array(); + protected $compatMap = array( + 'links' => array('link')); /** * Our specific element map

« previous php.pear.cvs (#36238) next »