Re: [phplib-users] PHP 5.2 and PHPlib
Brought to you by:
nhruby,
richardarcher
From: Lindsay H. <fmo...@fm...> - 2008-04-12 01:04:39
|
On Fri, 2008-04-11 at 19:00 -0500, Mike Green wrote: > I still use the PHPLib DB and Template classes a lot. So bringing > these up-to-date and/or making them a part of PEAR, without changing > their APIs would, for me, be a great benefit. I'm stuck with PHPlib's Cart class for several customer online shopping sites :-) It's simple and rather nice, and I've morphed and expanded it to suit my needs, but I note that it's not even documented on the PHPlib website anymore. I've never used PHPlib's Template class, although I've recently started using Smarty templates on some of my newer projects. Smarty is under active development. > I stopped using PHPLib sessions in favor of using PHP native sessions > a while back. And I have written my own routines to replace OOForms > and the authentication functionality of PHPLib. I'm afraid that I am > quite guilty, however, of not keeping the same APIs for these. So, > even if I were to clean them up and properly document them, they would > not be drop-in substitutes for those of PHPLib. :-( Because I have a bunch of customer websites built on top of PHPlib I pretty much have to keep at least the application-level class method and object API consistent. > Writing the two paragraphs above makes me feel more than a little > hypocritical -- having asked that others improve upon the DB and > Template classes while keeping the old APIs and at the same time not > keeping the APIs for the OOForms and authentication routines for my > own replacements for these. :-[ There's some pretty arcane stuff in the PHPlib API such as the haltmsg() and link_id() methods in the DB_Sql class. I dropped some of these, with no loss of functionality as far as my applications are concerned. I intentionally crafted the API on my DB class to work with PHPlib since there are so many other classes in PHPlib that require DB access, and also because I thought I might want to share it. I'll send it to you in private email. The only reason to keep the APIs constant for you own code is if you plan to share it, or integrate it into existing applications which expect it. I go both ways on this. I've put together, for instance, a simple "uservar" class that handles user variables better than does PHPlib's User class, and has only 4 methods and a constructor, and a PermAuth class that's based on PEAR::Auth and is a functional equivalent of the Perm class in PHPlib but is used quite differently. I'm pleased to note that PHPlib seems to work quite well with PHP5, so it's still in my toolkit, although all the PHPlib documentation talks about PHP3, and about PHP4 as if it were something new. Most hosting admins these days are migrating off of PHP4 as fast as they can since the security folks at the PHP project have thrown up their hands on it and new LAMP installs are all based on PHP5. -- Lindsay Haisley | "In an open world, | PGP public key FMP Computer Services | who needs Windows | available at 512-259-1190 | or Gates" | http://pubkeys.fmp.com http://www.fmp.com | | |