Re: Duplicating code between packages.
| From: | Pierre-Alain Joye | Date: | Sat, 14 Jun 2003 17:35:32 +0000 |
| Subject: | Re: Duplicating code between packages. | ||
| References: | 1 2 3 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-17464@lists.php.net to get a copy of this message | ||
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