Re: Proposal for a XML_Atom Library in the PEAR packages

From: Date: Fri, 05 Sep 2008 15:52:10 +0000
Subject: Re: Proposal for a XML_Atom Library in the PEAR packages
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-50716@lists.php.net to get a copy of this message
Hi Chrislain, I wrote an XML_Atom package but never pushed it to PEAR because I didn't have time to write proper API documentation. It uses the DOM extension to create and render Atom documents. My package doesn't handle any of the publishing protocol, only the syndication format. You can check out my code at https://code.silverorange.com/browser/public/xml-atom/trunk . It's also available as a package 'XML_Atom' in the PEAR channel pear.silverorange.com. At first glance, what you've written seems very similar. I think a comprehensive XML_Atom proposal should include: 1.) Ability to write Atom feeds (like my XML_Atom package and your Atom package) 2.) Ability to parse existing atom feeds into PHP objects. This should be fairly easy once #1 is done. 3.) Atom publishing protocol. Incomplete proposal at http://pear.php.net/pepr/pepr-proposal-show.php?id=376 Anyway, I look forward to your proposal and maybe you can take some ideas from my code :) Mike On Fri, 2008-09-05 at 15:26 +0200, Chrislain Jemba wrote: > Hello, > First of all, i would like to apologize for my english mistakes. > > In order to build a server-side implementation of the ATOM publishing > protocol, i , first, planned to make a library which could easily handle any > Atom feed: > - By converting an Atom feed in a PHP Atom_object > - By converting a PHP Atom_Object in an Atom feed > > For sure, this library will strictly follow the Atom Syndication Format. > > From now here is an example of implementation: > > $feed=new Atom_Feed(); > $feed->addAttribute('class','test'); > * $feed->setTitle(new Atom_Title('Example Feed', > array('key'=>'value'))); > * > $feed->addLink(new Atom_Link(null,array('href'=>' I¢ˆº¤ÙG > ”ºå¹bÝ¢http://example.org/')) > ); > $feed->setUpdated(new Atom_Updated(new DateTime('2003-12-13 18:30:02 > GMT'))); > $feed->addAuthor(new Atom_Author('John Doe')); > $feed->setId(new > Atom_Id('urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6')); > $entry = new Atom_Entry(); > $entry->setTitle(new Atom_Title('Atom-Powered Robots Run Amok')); > $entry->addLink(new Atom_Link(null,array('href'=>' > http://example.org/2003/12/13/atom03'))); > $entry->setId(new > Atom_Id('urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a')); > $entry->setUpdated(new Atom_Updated(new DateTime('2003-12-13 18:30:02 > GMT'))); > $entry->setSummary(new Atom_Summary('Some text.')); > $feed->addEntry($entry); > > You may be think at a first glance, that this implementation is too complex. > Therefore, I also planned to enable that kind of syntax > *$feed->setTitle('Example feed', array('key'=>'value'))* > > I think this second example could be more pleasant to implement, but the > good thing in the first example, is that we control the type of the > parameter > Therefore i would like to have your opinion and may be your approval for > that project, before trying to create an account on the PEAR website. > Thanks a lot for your answers.

« previous php.pear.dev (#50716) next »