Re: php5 packages - interfaces

From: Date: Fri, 16 Apr 2004 17:39:44 +0000
Subject: Re: php5 packages - interfaces
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-27792@lists.php.net to get a copy of this message
Hundiak, Arthur wrote:
Will PEAR be forever based on PHP4 or will we eventually start seeing PHP5
specific classes taking advantage of the PHP5 enhancements? (I know we already have PHPUnit2 but that kind of lives in it's own world anyways).
I want to state again that I dont think we need to start thinking in this frame of mind at all. A package doesnt get better just because it uses some PHP5 feature. if a package worked well for PHP4 and also runs on PHP5 then I dont see a need to move to PHP5 just for the sake of being able to use interfaces or mark soemthing as privat. However Interfaces are a different story. However even for interfaces its not always required to start a new package. For MDB2 I have a separate file which contains the Iterator class. Autoload we can address by finally cleaning up our class name to filesytem mapping, but this is something that we would want to have even if there is no autoload and no PHP5. So really if you find a feature in PHP5 which will actually enhance your package (and I dont see all the abilities to technically force your code/users to some contract - interface, public/private etc. - as a significant enough reason) then make a new major version which is PHP5 only. For new packages the same goes. If there is a significant benefit of being PHP5 only then sure mark your packages as PHP5 only and use all the goodies. PHPUnit2 is a prime example of what I am talking about. Its build around the reflection API so it needs PHP5.
4. Class constants, overloads, autoload,abstracts,constructors,destructors,cloning - all kinds of fun
Autoload we can address by finally cleaning up our class name to filesytem mapping, but this is something that we would want to have even if there is no autoload and no PHP5. Constructors, Destructors, cloning can all be handled in a BC compatible way.
5. Naming convention IMHO, it would be useful to rename classes to indicate they are PHP5 only. The main reason being that allowing both the old class and the new class to be used in the same script at the same time might ease migration and testing efforts. My own humble suggestion would be to just stick the number 5 after the category i.e. XML5_Parser.
no need, we have a guideline on how to handle BC breaking releases. regards, Lukas Smith smith@backendmedia.com _______________________________ BackendMedia www.backendmedia.com berlin@backendmedia.com Linn Zwoch Smith GbR Pariser Str. 44 D-10707 Berlin Tel +49 30 83 22 50 00 Fax +49 30 83 22 50 07

« previous php.pear.dev (#27792) next »