Re: Re: PEAR2 Coding standards, Autoloading and Namespaces

From: Date: Sat, 12 Apr 2008 22:34:44 +0000
Subject: Re: Re: PEAR2 Coding standards, Autoloading and Namespaces
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-49780@lists.php.net to get a copy of this message
On Apr 8, 2008, at 5:01 AM, Helgi Þormar Þorbjörnsson wrote:
I must admit I could see the merit of having it in the same folder,
but with your idea would PEAR2::File::CSV::Foo be in the same dir as CSV or in File/CSV/Foo.php ?
I think that PEAR2::File::CSV::Foo would have to map to PEAR2/File/CSV/Foo.php However, I am not sure one would want to use a third level of namespace. An advantage to PEAR2::File::CSV_Foo Is that it gets placed at the same location in the file system, but that class can access other classes in the PEAR2::File namespace without using their fully qualified class names. Introducing a third namespace: namespace PEAR2::File::CSV; Isolates the classes inside the namespace from the ones in other namespaces (including PEAR2::File).
Also say PEAR2::File::CSV:: Bar (or the lowercase, which ever way we go) is in a completely new package, say someone outside the File package wanted to add something new ... Basically a PEAR2_File_CSV_Bar package, which until now has been competly okey (See MDB2 drivers for example) ... Where would that be installed ? Along side Foo.php in the installation dir or somewhere else ?
See my other post on breaking away from looking for dependencies at specific locations. Best Regards, Jeff

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