Re: Re: PEAR2 Coding standards, Autoloading and Namespaces
| From: | Jeff Moore | Date: | Tue, 08 Apr 2008 08:52:18 +0000 |
| Subject: | Re: Re: PEAR2 Coding standards, Autoloading and Namespaces | ||
| References: | 1 2 3 4 5 6 7 8 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-49697@lists.php.net to get a copy of this message | ||
On Apr 6, 2008, at 6:45 AM, Helgi Þormar Þorbjörnsson wrote:
On Sat, Apr 5, 2008 at 11:45 PM, Jeff Moore <jeff@procata.com> wrote: Yeah, I wouldn't do it that way either. Why not: - pear-root -- File --- File.php --- CSV.php --- Util.php Am I missing something in my ignorance? ;) Only that you can't map File.php properly anymore, sub class and parent class in the same folder.Sub class and parent in the same folder? Huh? The way to think about it is its everything in the same package in the same folder. The fully qualified class names would be: PEAR2:File:File PEAR2:File:CSV PEAR2:File:Util Putting all three in the same namespace and the same folder.
The idea has always been: if I have a class named File I include with File.php, if it's File_Foo_Bar I do include File/Foo/Bar.php So would you not find it confusing that it would change to: If I have a class named File I do File/File.php and if I have File_Foo I do File/Foo.php, implies that first include would give you File_File class, can be kinda sketchy changing the a bit of a core part of PEAR but well since we are changing a check of a lot of things ....Here is the thing, why would you call the class File_Foo, if its already in the File namespace? Use File::Foo, or rather PEAR2::File::Foo. Or pear2::file::Foo with Travis' proposal.
svn:external, can't say I've used it a lot ... mostly to link libs into a app that did not follow anything related to PEAR structure, iirc ;-)I keep running into it. Where I'm working now, they use svn:externals for several things. For PEAR, they check in the install directory to use it like an svn:external. (I say they instead of we because this was setup before I got there.) I can tell you the depth of the directory tree in this setup is extremely annoying. Consider that the current directory structure for http://cvs.php.net/viewvc.cgi/pear/File in subversion requires two File folders. The alternative that I am describing uses only one Best Regards, Jeff