Re: Duplicating code between packages.

From: Date: Mon, 16 Jun 2003 15:39:50 +0000
Subject: Re: Duplicating code between packages.
References: 1 2 3 4  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-17516@lists.php.net to get a copy of this message
I would say that it's better to evaluate the tmpdir each time instead of setting a fixed value, as most apps do. System::tmpdir() does the right steps for finding the correct tmpdir. Tomas V.V.Cox ----- Original Message ----- From: "Pierre-Alain Joye" <paj@pearfr.org> To: "Tomas V.V.Cox" <cox@idecnet.com> Cc: <peter@mapledesign.co.uk>; <pear-dev@lists.php.net> Sent: Saturday, June 14, 2003 7:35 PM Subject: Re: [PEAR-DEV] Duplicating code between packages. > On Sat, 14 Jun 2003 18:07:18 +0200 > "Tomas V.V.Cox" <cox@idecnet.com> wrote: > > > As easy as: > > > > <?php > > include 'PEAR/Config.php'; > > $config = PEAR_Config::singleton(); > > $php_dir = $config->get('php_dir'); > > ?> > > > > There is no var for setting a temp folder in the pear cmd config, but > > you could use System::mktemp() or System::tmpdir() for that. > > > Ah yes, you are right :). I was confused with go-pear wich asks for the > temp folder. > > What do you think to add it quickly? > > The good thing is I can add it to the ENV vars. These ENV should be used > if they are defined: > > $tmpFolder = getenv('PHP_PEAR_CONFIG_TEMPFOLDER'); > > or we can use the PHP_PEAR_CACHE_DIR instead, it's a kind of temp folder > :). > > The same way works for datas in preferences to weird assumption like > __FILE__.'../data' ;-). > > comments? > > pierre > >

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