Re: AW: [PEAR] Problem with inner Pear include() statements

From: Date: Thu, 06 Jan 2005 19:17:02 +0000
Subject: Re: AW: [PEAR] Problem with inner Pear include() statements
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-16744@lists.php.net to get a copy of this message
n Thu, 6 Jan 2005 17:37:35 +0100, Mirco Blitz <webmaster@lindworm.de> wrote: > Hi, your solution should look like this. > > Linux Server > $path = ini_get("include_path"); > $path .= ":".PEAR_LIB_PATH; > ini_set("include_path", $path); > > Windows Server > $path = ini_get("include_path"); > $path .= ";".PEAR_LIB_PATH; > ini_set("include_path", $path); If you use PATH_SEPARATOR you can have the same code for both systems. Plus, what if there's no include path set? (yeah, I know, who would do that?) $path = ini_get('include_path'); $path .= (strlen($path) ? PATH_SEPARATOR : '').PEAR_LIB_PATH; ini_set('include_path', $path); > > And then simply include PEAR normaly. > > Greeting > Mirco > -----Ursprüngliche Nachricht----- > Von: Hugues Peeters [mailto:peeters@ipm.ucl.ac.be] > Gesendet: Donnerstag, 6. Januar 2005 16:55 > An: pear-general@lists.php.net > Betreff: [PEAR] Problem with inner Pear include() statements > > Hi Pearers, > > Our team started to use Pear for our software developpment some weeks > ago. And we've just faced a big problem. > > We would like to provide into our package the basic Pear files needed > for our application to work, in case of Pear was not installed on the > user server. > > We though to define a PEAR_LIB_PATH constant and use statement like > > include(PEAR_LIB_PATH . 'Auth/Auth.php'); > > That way, the system administrator is free to change path and point to > its own Pear directory if he prefers. > > But, sadly, it doesn't solve the problem, as some inner Pear include() > and require() statements still rely on the php.ini 'include_path' > configuration. > > Do you have any idea to solve the problem ? > > Best regards, > > Hugues Peeters > --- > peeters@ipm.ucl.ac.be > http://www.claroline.net > -- Justin Patrin

« previous php.pear.general (#16744) next »