RE: [PEAR-DEV] Re: PEAR2 Coding standards, Autoloading and Namespaces
| From: | Baptiste Autin | Date: | Sat, 05 Apr 2008 13:19:53 +0000 |
| Subject: | RE: [PEAR-DEV] Re: PEAR2 Coding standards, Autoloading and Namespaces | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-49633@lists.php.net to get a copy of this message | ||
>Namespaces are good to avoid clashes as in "play nicely with other
>libraries". Right now you cannot have a date class if you use the pear one.
A pear developer that really wants to have a Date class in its package can
namespace it:
Florida::Vacations::Date
And not:
PEAR2::MyCategory::MyPackage::Date
And it will work as well.
But you will probably want to enforce something homogeneous and coherent for
all new PEAR packages, right?
So you are discussing about naming (compelling long classnames) and about
structure, and possibly, incidentally, about giving up the actual category
system, and setting up a hierarchical, multi-leveled model (no matter how
you then implement it in the filesystem, by PEAR2's autoloading or whatever)
Eg, is PEAR willing to define, from now, an "HTTP" package that will enclose
other packages? And why not, a "Protocol" package, that will enclose HTTP
and Mail? This is NOT a namespace topic at all.
PEAR could have set up from long a system like:
PEAR_MyPackage1_MyPackage2_MyClass
Even in PHP4.
The deep questions are about a new organization and new naming conventions.
The PHP instructions "namespace & use" do not bring any answer to those
questions, they have just raised them (again?)
Yet I am asking whether:
- This is precisely PEAR2's challenge? The PEAR2 class-to-file conventions
seem to be quite vague on those matters
- PHP6 can provide, at the current time, enough to achieve those new goals
in a simple way
Am I completely off track?? :)
Baptiste