Re: [Fwd: Re: PEAR framework changes for PHP5]

From: Date: Sat, 31 Jan 2004 23:12:26 +0000
Subject: Re: [Fwd: Re: PEAR framework changes for PHP5]
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-25383@lists.php.net to get a copy of this message
On 31 Jan 2004 at 14:19, Hans Lellelid wrote: > > You can already do that, without introducing more complexity. Most, > > if not all, PEAR packages refer to include files using relative > > paths. So, all you need to do is add your include dir ahead of > > PEAR's: > > ini_set('include_path', > > realpath(dirname(__FILE__) . "/classes") . > > (DIRECTORY_SEPARATOR == '/' ? ':' : ';') . > > ini_get('include_path')); > > > > Now, if some PEAR class exists in you classes directory, it is > > preferred over the one in PEAR. > > > I thought that PEAR classes generally included files according to how > they are located in PEAR. E.g. Log looks for Log/drivername.php, MDB > would look for a driver at MDB/drivername.php, etc. I'm aware that I > could make my directory structure look like PEAR's and simply > prioritize my classes in the include_path; I've seen other packages do > this, but the point is that I don't think this should be necessary. > > I also dislike that all driver classes have to follow the > namespace-style PEAR naming conventions (i.e. my Log driver class > would have to be named Log_mydriver), but that is something I can live > with until PHP has namespace support -- if ever :( I don't get the point. When e.g. There the user tries to access the data-component "bar" (in Image_Graph, which is currently in CVS), then simply check if a class Image_Graph_Data_Bar is already loaded / present. This should be no problem since PEAR-packages have an "almost" unique name. Only, and only(!), if the class is not yet present you may include 'Data/Bar.php' in this case. So big deal, easy to implement, and extendable - in my eyes. Regards, Stefan

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