Re: PEAR and PHP 5
| From: | Greg Beaver | Date: | Mon, 14 Apr 2003 17:08:24 +0000 |
| Subject: | Re: PEAR and PHP 5 | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-15167@lists.php.net to get a copy of this message | ||
HI Stig,
+1 on this idea. Some serious unit testing would be needed to make sure that pear doesn't crash on invalid PHP. The tokenizer parser we use in phpDocumentor assumes that code is valid, and so sometimes will crash php when it isn't (one of those impossible to isolate bugs that fixes itself when the code is made valid php).
Greg
Stig S. Bakken wrote:
What we could do is to always bundle ext/tokenizer in PHP 5 and re-format symbols in PHP 4 PEAR code during install. The purpose of this is to provide forward compatibility, so PHP 5 users can use PEAR packages written for PHP 4, without having to worry about re-writing any code when the package finally "goes 5". Let's take XML_Parser as an example. When a PHP 5 user installs the PHP 4 XML_Parser package, the PEAR installer rewrites the code like this: class XML_Parser extends PEAR { to: namespace PEAR:XML:Parser { class Parser extends PEAR { And also: class XML_Parser_Error extends PEAR_Error { to: namespace PEAR:XML:Parser { class Error extends PEAR:Error { PEAR 1.1 already does checks that code confirms to the naming standard, taking it one step further should not be too hard. But this approach requires that the coding standard is followed strictly (which is exactly one of the reasons for the check in PEAR 1.1). Let me repeat the benefits of doing this: * no need to split PEAR in one PHP 4 world and one PHP 5 world * PHP 5 users will have access to most PEAR packages immediately * PHP 5 users do not have to change their code when a PEAR package "goes 5" Comments? - Stig