1
Runaway
Re: XOOPS and PEAR ?
  • 2003/10/25 0:14

  • Runaway

  • Just popping in

  • Posts: 2

  • Since: 2003/2/4 1


PEAR is a lot more than a database abstraction layer.

It is a whole library of really useful high quality classes. Recently PEAR has really been maturing as a project and the number of cool new packages that are being added is going up rapidly.

The database layer thing is an interesting issue. It's occured to me that if someone just made an XOOPS db driver for PEAR:B, then you would get compatibility with all those other databases just for the work of doing one. Still, as other have said that's a lot of work - and testing. And I don't know if it would be compatible with the other cool PEAR:B classes like DB_DataObject.

But like I said, PEAR is more than a database abstraction. There's some really time saving classes in there. One of the modules that I want to develop for xoops, I'm thinking of making it require PEAR, just because of the amount of time it will save to develop the module.

Check this out:
http://www.headbonk.com/feeds.php

This script was written using the XML_RSS PEAR package with about 12 lines of code:

require_once "XML/RSS.php";

$rss =& new XML_RSS("");
$rss->parse();

$channelInfo $rss->getChannelInfo();

echo 
'

Headlines from .$channelInfo['link'].'">'.$channelInfo['title'].'

'
;

echo 
'

'.$channelInfo['description'].'

'
;

echo 
"
    n";
    foreach (
    $rss->getItems() as $item) {
        echo 
    "
  • $item['link'] . "">" .$item['title'] . "
  • n"
    ;
    }
    echo 
    "
n"
;
?>


Note also, that this rss parser is more robust than the one that is bundled with XOOPS. It will handle feeds that XOOPS can't.

Anybody have any thoughts about whether it would be acceptible to require PEAR for an XOOPS module? (not for DB, but for other packages like the one above)




TopTop



Login

Who's Online

203 user(s) are online (181 user(s) are browsing Support Forums)


Members: 0


Guests: 203


more...

Donat-O-Meter

Stats
Goal: AU$15.00
Due Date: Jul 31
Gross Amount: AU$0.00
Net Balance: AU$0.00
Left to go: AU$15.00
Make donations with PayPal!

Latest GitHub Commits