Re: Extension publication (RSS)

From: Date: Mon, 16 Apr 2012 15:58:59 +0000
Subject: Re: Extension publication (RSS)
References: 1 2  Groups: php.pecl.dev 
Request: Send a blank email to pecl-dev+get-9319@lists.php.net to get a copy of this message
Hi! The license will be changed, I'll just have to go through the various licenses to see which one fits the best. (A first glance at PHP's own license tells me it's acceptable) This will be done in the new repository created for the extension when it's set up. A new one will be set up that corresponds better with PHP's own ext/foobar/* directory tree etc - since the current repo supplies the source files in multiple directories. It's easy to do quick implementations for reading RSS feeds, but the point of having this as an extension is to carry out the entire RSS validation for the developer. What would happen if you just loaded something other than a valid RSS feed running the example code you wrote? With the extension one is supposed to simply initiate a resource from a source (file, string) and then directly inspect any error code rather than the entire document for errors with PHP code. This would minimize the amount of effort required by the developer as well as improve performance on parsing RSS feeds. (might be minor differences, but should still be faster to do it through an extension) As RSS is a quite common feed format, this would also prevent developers from reinventing the wheel. An example usage would be, which does roughly what you wrote: $rss = rss_parse_file($filename); if (rss_errno($rss) != 0) return do_error_handling(); for ($i=0;$i<rss_get_channel_items();++$i) echo rss_get_item_description(rss_get_item($rss, $i)); Sure, the function names might be weird at this time, but this is easily changed to better reflect PHP standards. They're just direct clones of the C library at this time. As you can see though, the code gets a lot neater than if validation of the entire specification had been written in PHP. Mattias Lindholm (excuse my poor email client's history quotation following below) -----Ursprungligt meddelande----- Från: Pierre Joye [mailto:pierre.php@gmail.com] Skickat: den 16 april 2012 14:43 Till: Mattias Lindholm Kopia: pecl-dev@lists.php.net Ämne: Re: [PECL-DEV] Extension publication (RSS) hi! hi! On Mon, Apr 16, 2012 at 11:34 AM, Mattias Lindholm <mattias@xertoz.se> wrote: > I've written a C library for accessing RSS feeds and have been using > it for internal projects through an extension with PHP. The source > code can be viewed at https://github.com/Xertoz/librss - just > remember > that it is not a complete extension in terms of documentation (yet).   > An OOP interface can easily be written to wrap the one-to-one implementation of the original API. A couple of things: - GPL is not allowed in PECL - using GPL for libraries is totally pointless and makes the lib almost useless I would read the php ext code once the license has been changed :) > Since RSS is quite popular out there, others might benefit from using > such an extension like this. Therefore I would like to publish (and > maintain) it through PECL. Is this extension applicable for PECL? That being said, I wonder how easier it could be than: <?php foreach(simplexml_load_file($url)->entry as $it) echo $it->content; ?> That's hard to beat :) Cheers, -- Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org

« previous php.pecl.dev (#9319) next »