mibe/FeedWriter — pull request #7 by brennen (2013-01-20 19:15:30+00:00)
Title: namespace FeedWriter

A minimal set of changes to support PSR-0-style autoloading:

- rename base class to \FeedWriter\Feed and FeedItem to \FeedWriter\Item
- break types out into \FeedWriter\ATOM, \FeedWriter\RSS1, and
\FeedWriter\RSS2
- use class constants for versions
- make generateFeed() return a string rather than doing any IO itself
- add printFeed() to do output, if needed
- updated example code

My rationale for the last 2 items on that list is that our web framework expects me to pass around strings, not do direct IO. I imagine needing to grab the output and stash it in a variable or what-have-you is a common use case, and it felt silly to have to wrap this in an output buffer to accomplish that.

I went with FeedWriter for the base namespace, per @mibe's original suggestion, since it seemed nice and descriptive. If @ajaxray would strongly prefer that it be something like \axjaxray\FeedWriter, we could go that route easily enough.

Any comments appreciated.