Re: [PEPr] Comment on RFC::Prefix all packages with P_
| From: | Pierre | Date: | Thu, 03 Aug 2006 14:51:33 +0000 |
| Subject: | Re: [PEPr] Comment on RFC::Prefix all packages with P_ | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-43633@lists.php.net to get a copy of this message | ||
On Thu, 3 Aug 2006 10:46:13 -0400
danielc@analysisandsolutions.com (Daniel Convissor) wrote:
> 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.
You should really start to use/imagine another example, that's not going
to happen with Date or any of my packages :)
Cheers,
-- Pierre