Auto-detecting PHP4 vs. PHP5 PEAR packages
| From: | 11abacus.com) | Date: | Fri, 02 Apr 2004 20:37:18 +0000 |
| Subject: | Auto-detecting PHP4 vs. PHP5 PEAR packages | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-26971@lists.php.net to get a copy of this message | ||
Hi,
Before PEAR becomes a mess of dual version of packages, one dedicated to PHP 4 and one for PHP 5, wouldn't be possible to advise of a way to keep loading the packages the same way. This is provided that both versions of the packages provide the same API.
For some packages, a rewrite to take advantage of PHP5 could be welcome, but should the user be afflicted by having to edit each and every script when the package changes name? I'm taking for example the PHPUnit package, which has now a PHPUnit2 "version". Wouldn't it be nice to do a simple "require_once('PHPUnit.php)" regardless of the PHP version?
My "concern" is for people who don't have control over what version of PHP they use (i.e. customers of web hosting companies.) If you want to transfer a site from one host to another, it would be nice to not have to modify the scripts' "require_once" to point to the proper package name.
I read in one of the thread somewhere that the package should simply get a higher version # with a dependency for PHP > 5. Great, but shouldn't it be made into a PEAR policy instead of letting the package maintainers decide what they want. Besides if you want to change names, why not use PHPUnit*5* for instance, instead of PHPUnit*2*. It would make more sense, but still, I find that a less than idealistic solution.
I don't know what the best option is, but it sure would be worth it to figure it out *BEFORE* things start getting hectic.
1. Must the package names remain the same?
2. Should an intermediate file be used to "include_once" the proper file based on PHP version? If "yes", how should the files be organized?
3. ...?
Thanks for your time,
-Philippe
http://www.11abacus.com/