Object-oriented PHP and PEAR

Filed under: — 11:46 am

Despite being pretty familiar with object-oriented programming, I’ve managed to do all of my work in PHP so far without using objects. My reasons included PHP’s minimal support for objects in earlier versions, the ease of non-object-oriented PHP, and the fact that I wasn’t programming anything terribly complicated.

I decided to introduce myself to objects in PHP and found PEAR, the PHP Extension and Application Repository. This is a nice library of pre-made PHP packages to solve various problems. I don’t know why I always looked at the CPAN libraries first thing when starting a project in Perl, but never considered doing the same with PHP.

PEAR includes a few tantalizing packages: the Mail class can probably solve my never-ending problems with PHP’s email features. There’s an interface to the Google API. And a ready-made database abstraction layer. I’ll definitely be spending some time exploring PEAR and kicking myself for reinventing various wheels.

One response to “Object-oriented PHP and PEAR”

(c) 2001-2007 Michael Moncur. All rights reserved, but feel free to quote me.
Powered by WordPress