Re: factory broken

From: Date: Fri, 03 Aug 2001 10:56:36 +0000
Subject: Re: factory broken
References: 1 2 3 4 5  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-1268@lists.php.net to get a copy of this message
"Stig S. Bakken" wrote: > > "Tomas V.V.Cox" wrote: > > > > "Stig S. Bakken" wrote: > > > > > > "Tomas V.V.Cox" wrote: > > > > > > > > mailling@bigfoot.com wrote: > > > > > > > > > > I already sent this message to this list, but I got no answers/comments, so > > > > > I decided to send it again. > > > > > Either I am wrong, or every factories are broken. So comments would be > > > > > appreciated. > > > > > > > > > > > > > Pear DB isn't affected by this, others should be revised. > > > > > > > > > It migth be good also to add a constant such as PEAR_DIRECTORY to include > > > > > the file, because some ISP may not let you change the php.ini or work wirh > > > > > .htaccess > > > > > > > > Yeah, this is more problematic. For those who doesn't have access to > > > > php.ini, ini_set() or .htaccess, there is a big problem, not only with > > > > Pear I mean also with other php packages. Perhaps a user-land > > > > set_include_path() php function could help a lot. Other ideas about how > > > > to fix this problem? > > > > > > ini_set("include_path", ...) in your script seems to work even for > > > require. > > > > > > > ini_set() is other function that normally is disabled by ISP admins. > > So for "ISP victims", using the full path is the only solution? That > would be relatively easy to fix were it not for a (IMO) bug in how > include_path treats ".". "." is always relative to the original script, > not the file doing the include. If it had been the latter, we could > have used relative paths when including files within PEAR. Then it > would be enough for the "ini_set challenged" to use the full path in > their scripts. > I proposed a user land "set_include_path()", but is other function that is suitable to be disabled :). Or use our PEAR_INSTALL_DIR prefix in all the include's. The PHPLIB guys solved it with something similar: (prepend.php3) # Aren't we nice? We are prepending this everywhere # we require or include something so you can fake # include_path when hosted at provider that sucks. $_PHPLIB["libdir"] = ""; An urgent solution for developers could be to do manually includes at the top of the code: define('PREFIX', '../../'); require_once PREFIX . 'PEAR.php'; require_once PREFIX . 'DB.php'; require_once PREFIX . 'DB/common.php'; include_once PREFIX . 'DB/mysql.php'; This should work and only needs to redefine the constant relative to the dir they are. But all of this thing are ugly, I could not imagine a bash shell without $PATH. Tomas V.V.Cox

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