[dev] Horde_Feed api evolution
Chuck Hagenbuch
chuck at horde.org
Thu May 17 19:33:38 UTC 2007
Quoting Chuck Hagenbuch <chuck at horde.org>:
> 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.
I've done this.
> 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.
I've done this also. Looks good so far.
> 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.
I've implemented this in Horde_Xml_Element as a fromArray() method -
integrating it into the Feed stuff will be easy at this point. I'd
like feedback on the method name and the implementation, and if it's
worth supporting nested values.
-chuck
More information about the dev
mailing list