Tag Archive | "pear"


HOWTO: working with PEAR

Posted on 19 April 2005 by Demian Turner


I’m posting this to clear up how to find the PEAR path on most servers, and then at the end are instructions how to use PEAR in your PHP programs.

Editors note: this article is for beginner to intermediate level users, and I think will be useful to many as reported problems installing PEAR are still widespread in the forums, etc. – Demian

Comments (4)


Advantages of using the PEAR class naming convention

Posted on 09 March 2005 by Demian Turner

There are many good reasons for following the PEAR coding standards which I don’t have time to go into now, a slightly elabourated version of the ‘rules’ is available here, mostly borrowed from the Horde project.

But by far the most convincing reason to use the file naming convention, which means that a class located in your include path like Foo/Bar/Baz.php is called Foo_Bar_Baz, is the ability to take advantage of PHP 5’s __autoload magic method.

What this means is that if you instantiate the above class, and forgot to require it, it can be located and loaded automatically, from any of hundreds of classes in your include path. Here’s the code:

function __autoload($class)
  $filename = str_replace('_', '/', $class) . '.php';
  @require_once $filename;

Comments (6)


Filtering and Modifying Directory Listings with File::Util

Posted on 10 February 2005 by Demian Turner

If you need to run directory listings through various filters and transforms,
File_Util::listDir is your friend, especially with the recently added callback
final arg.

Check out recent Seagull code updates to see the flexibility of the current approach,
we need to consolidate all Seagull directory methods in order for next step of
front controller to be implemented.

getAllNavDrivers() is the first converted method, it makes use of callbacks,
lambda fns and pass-by-ref to update filtered dir listings.

Comments (0)


PEAR Channels almost ready with imminent release of v. 1.4

Posted on 09 February 2005 by Demian Turner

Our man Greg
has been working overtime getting the latest
version of the PEAR
package manager ready. He also has a blog which is a great
way to keep uptodate with all the latest PEAR package mgr
news. Some recent entries include:

If you really want to know everything that’s gone on with the package manager, you can read through the posts at http://news.php.net/php.pear.core.
And if you’ve read all this and you’re wonder "why is this guy always
going on about PEAR package mgr" (as indicated by the poll in the
bottom left corner 😉 then just keep in mind some of the following:

  • one of the keys to the success of the Linux platform is tools like RPM, apt-get and more recently yum
  • one of the pillars of Redhat’s success is the RHN or Redhat Network
  • package management has a long history with other languages and a well-trodden track record with, eg, CPAN.

Comments (0)

Tags: ,

HTML_Template_Flexy plugins tutorial

Posted on 23 January 2005 by Demian Turner

Thanks to Rares for this new Flexy plugins tutorial, check it out here and take advantage of this powerful aspect of the Flexy templating system.

Comments (0)

Tags: , ,

PEAR Tutorials

Posted on 20 January 2005 by Demian Turner


PEAR manual
PEAR overview
Getting started with PEAR
Introduction to PEAR
PEAR based Deployment
Inside PHP and PEAR Development
PEAR and PECL Packaging
Web installer
Web installer (*)
* works with PHP 4.2.3

Package Tutorials

Archive_Tar http://www.melonfire.com
Archive_Tar http://www.contentmanager.de (German)
Cache http://www.onlamp.com
Cache http://www.ulf-wendel.de (German)
Cache_Lite http://www.melonfire.com
Config http://www.devshed.com
Config http://www.phpkitchen.com
Console_* http://www.phpkitchen.com
Console_Getopt http://www.sitepoint.com
Crypt_HMAC http://php-mag.net
Date_Holidays http://blog.php-tools.de
DB (improvements) http://www.php-mag.net
DB http://www.devshed.com
DB http://evolt.org
DB http://www.nusphere.com [pdf]
DB http://www.onlamp.com
DB http://www.phpbuilder.com
DB http://www.devshed.com
DB (portability) http://www.php-mag.net
DB_DataObject http://www.phpkitchen.com
DB_DataObject http://www.sitepoint.com
Error http://conf.php.net
Error http://www.php-mag.net
File_Archive http://poocl.la-grotte.org
HTML_AJAX http://blog.joshuaeichorn.com
HTML_Menu with DB_NestedSet http://trac.seagullproject.org
HTML_Progress http://pear.laurent-laville.org
HTML_Template_Flexy plugins http://trac.seagullproject.org
HTML_Quickform http://www.devarticles.com
HTML_Quickform http://www.devarticles.com
HTML_Quickform http://www.thelinuxconsultancy.co.uk
HTML_Quickform http://www.devarticles.com
HTML_Quickform http://www.onlamp.com
HTML_Quickform http://www.pookey.co.uk
HTML_Table http://dev.obliquid.com
HTML_Table http://www.phpbuilder.com
HTML_Table http://pear.php.net
HTML_Template_ITX http://codewalkers.com
HTML_TreeMenu http://www.phpkitchen.com
HTTP_Upload (multiple files) http://zarski.com
Image_Graph http://pear.veggerby.dk
LiveUser http://www.backendmedia.com
LiveUser http://pear.limbourg.com
Log http://www.indelible.org
Log http://www.phpbuilder.com
Mail http://www.zend.com
Mail http://pear.php.net
Mail_Mime http://www.contentmanager.de
Mail_Queue http://pear.php.net
MDB http://php-mag.net
Net_Dict http://freedomink.org
Numbers_Words http://builder.com.com
Pager vs. Pager_Sliding http://pear.php.net
PHPdocumentor http://builder.com.com
PHPdocumentor http://phpdoc.org
PHPdocumentor http://talks.php.net (mozilla only)
PHPUnit http://www.phpunit.de
SOAP http://www.oikoyama.net
SOAP http://www.onlamp.com
SOAP http://www.phppatterns.com
SOAP http://www.devchannel.org
Spreadsheet_Excel_Writer http://www.phpmag.net (bottom of page)
Spreadsheet_Excel_Writer http://pear.php.net
Spreadsheet_Excel_Writer http://www.sitepoint.com
Spreadsheet_Excel_Writer http://www.akademie.de (German)
Structures_DataGrid http://www.samalyse.com
Text_Captcha http://phpsec.org
Text_Statistics http://www.phpkitchen.com
Translation2 http://pear.php.net
Translation2 http://www.alberton.info
Translation2 http://www.alberton.info
Tree http://www.phpkitchen.com
XML_Parser http://www.schst.net
XML_RPC http://codewalkers.com
XML_RSS http://freedomink.org
XML_Serializer http://www.devshed.com
XML_Serializer http://freedomink.org
XML_Serializer http://www.sitepoint.com
XML_sql2xml http://php.chregu.tv
XML_Statistics http://builder.com.com
XML_Transformer http://www.xml.com
XML_Tree http://www.melonfire.com

Comments (18)

Tags: , ,

PEAR::Tree Tutorial

Posted on 27 April 2003 by Demian Turner

Thanks go out to Wolfram Kriesing for having put together the following tutorial for the excellent PEAR::Tree package.

For those of you who don’t know, PEAR::Tree is a package that provides methods to read and manipulate trees, which are stored in the DB or an XML file. The trees can be stored in the DB either as nested trees. Or as simple trees, which use parentId-like structure. Currently XML data can only be read from a file and accessed. The package offers a large number of methods to access and manipulate trees. For example methods like: getRoot, getChild[ren], getParent, getPath and many more.

To get up and running you will need to download the package from the PEAR site.  Here are the API docs to get you started.

UPDATE: there are a number of sites linking to this page, I’m afraid a link to the cited tutorial is no longer available as the original author removed it.

Comments (10)



Demian Turner's currently-reading book recommendations, reviews, favorite quotes, book clubs, book trivia, book lists



PHPkitchen recommends you also check out the following sites :

Accounting for Small Businesses

FreeAgent sign-up