Re: [PEPr] Comment on RFC::Prefix all packages with P_
| From: | Daniel Convissor | Date: | Thu, 03 Aug 2006 14:46:13 +0000 |
| Subject: | Re: [PEPr] Comment on RFC::Prefix all packages with P_ | ||
| References: | 1 2 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-43631@lists.php.net to get a copy of this message | ||
Hi Scott:
On Wed, Jul 12, 2006 at 11:34:23AM -0400, Scott Mattocks wrote:
> Hi Pierre,
>
> So we update Validate to P_Validate, but Date hasn't been updated yet.
> What does P_Validate now optionally depend on?
The package names don't need to change. Just the class names.
The transition can be easy by using Greg's suggestion:
---- PEAR/Date.php ----
// New file to conform with naming conventions.
class PEAR_Date {
// Actual gets moved into here.
}
-----------------------
---- Date.php ----
// Old file with empty stub class for backwards compatibility.
require_once 'PEAR/Date.php';
class Date extends PEAR_Date {
}
------------------
With this pattern, the old and new files and class names remain in tact.
Thus, older PEAR packages and userland scripts are not forced to change
anything. This enhancement can even be done inside a regular release of
a package.
--Dan
--
T H E A N A L Y S I S A N D S O L U T I O N S C O M P A N Y
data intensive web and database programming
http://www.AnalysisAndSolutions.com/
4015 7th Ave #4, Brooklyn NY 11232 v: 718-854-0335 f: 718-854-0409