RE: [PEAR-DEV] dirname(__FILE__)

From: Date: Thu, 17 Oct 2002 08:49:36 +0000
Subject: RE: [PEAR-DEV] dirname(__FILE__)
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-10094@lists.php.net to get a copy of this message
> From: Alan Knowles [mailto:alan@akbkhome.com] > Sent: Thursday, October 17, 2002 3:00 AM > Cc: 'PHP PEAR Developer' > Subject: Re: [PEAR-DEV] dirname(__FILE__) > > I was thinking along the lines of > require_once @PEAR. 'PEAR.php' > on this principle - if you have set up pear 'as currently' in you > include class, there is no need to define PEAR, otherwise, if you are > using it in your application > define('PEAR', '/path/to/my/pear'); > > However! > > Trouble is that this makes it more difficult to say 'use the core pear > packages from /usr/share/pear' and use local packages eg. /home/me/pear/ > at the same time. > > Is there some bit problem on using ini set, as mentioned below: > either that or why not automate it inside PEAR.php > if (!preg_match('/;' . dirname(__FILE__) . ';/')) { > > > ini_set('include_path',ini_get('include_path').SEPERATOR.dirname(__FILE_ _) > ); > } > or similar , and say if you cant change your php.ini, just require_once > /wherever/my/pear/PEAR.php and all the paths will be sorted out. > Well the reason I suggested dirname(__FILE__) is that I need to distribute any installation with the pear packages it requires. This is for QA reasons. There may of course be different installations on the same server where different versions of a single pear package are used. Therefore using an include path is not really a solution for me. And I think a lot of people will be in a similar situation. Then again I can make these modifications myself as well. Regards, Lukas

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