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

From: Date: Sat, 31 Jan 2004 19:19:47 +0000
Subject: Re: [Fwd: Re: PEAR framework changes for PHP5]
References: 1 2 3 4 5 6  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-25370@lists.php.net to get a copy of this message
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 :( Hans

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