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:

<?php
require_once "XML/RSS.php";

$rss =& new XML_RSS("<Xoops backend URL>");
$rss->parse();

$channelInfo $rss->getChannelInfo();

echo 
'<h1>Headlines from <a href="'.$channelInfo['link'].'">'.$channelInfo['title'].'</a></h1>';

echo 
'<p>'.$channelInfo['description'].'</p>';

echo 
"<ul>n";
foreach (
$rss->getItems() as $item) {
    echo 
"<li><a href="" . $item['link'] . "">" .$item['title'] . "</a></li>n";
}
echo 
"</ul>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

209 user(s) are online (168 user(s) are browsing Support Forums)


Members: 0


Guests: 209


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits