[dev] Horde_Feed api evolution
Chuck Hagenbuch
chuck at horde.org
Mon May 14 19:06:59 UTC 2007
Hi folks-
I'd like feedback on some plans to change the Horde_Feed API a little
to make generating feed content (as well as reading it) easier, and to
generally clean up/improve the API.
First proposal: remove the code in Horde_Feed_Abstract to load feeds
via HTTP. We have Horde_Feed::readUri() and the other
Horde_Feed::read* methods for that.
Second, I'd like to switch the order of $uri and $element in the
Horde_Feed_Abstract constructor, so that $element comes first. With
$uri not used for reading anymore, it really is optional, and $element
can be used to pass in initial data when instantiating a feed
directly. This also goes into my last proposal:
Allow $element to be an array of simple children to set on the feed
(or entry - this functionality would probably go in to
Horde_Xml_Element). I'm proposing that $element could be a simple
name/value array, with a syntax of elementname#attributename. Easier
to show it:
$atom = new Horde_Feed_Atom(array('link#href=foo',
'#xmlns=rss'));
This would result in the following XML:
<feed xmlns="rss">
<link href="foo" />
</feed>
In other words, # is translated into an attribute name, either on a
child or on the feed itself.
Thoughts? Any other ideas for changes/improvements to the feed api?
-chuck
More information about the dev
mailing list