From: Pierre Joye Date: Thu, 29 Aug 2002 10:08:37 +0000 (+0000) Subject: Hope to finnally got it, fixes notice (Thx to Sebastian) X-Git-Tag: RELEASE_0_91~183 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a00f439ff08ffc3c2476ca93f77cbeb8390143b0;p=php Hope to finnally got it, fixes notice (Thx to Sebastian) --- diff --git a/pear/System.php b/pear/System.php index e2c35e6068..9808233cb9 100644 --- a/pear/System.php +++ b/pear/System.php @@ -385,44 +385,31 @@ class System /** * Get the path of the temporal directory set in the system * by looking in its environments variables. + * Note: php.ini-recommended removes the "E" from the variables_order setting, + * making unavaible the $_ENV array, that s why we do tests with _ENV * * @return string The temporal directory on the system */ function tmpdir() { if (OS_WINDOWS) { - if (($var=$_ENV['TEMP']) || $var=getenv('TEMP')) { - return $var; + if ($var = isset($_ENV['TEMP']) ? $_ENV['TEMP'] : getenv('TEMP')) { + return $var; } - if (($var=$_ENV['TMP']) || $var=getenv('TMP')) { - return $var; + if ($var = isset($_ENV['TMP']) ? $_ENV['TMP'] : getenv('TMP')) { + return $var; } - if (($var=$_ENV['windir']) || $var=getenv('windir')) { - return $var; + if ($var = isset($_ENV['windir']) ? $_ENV['windir'] : getenv('windir')) { + return $var; } return getenv('SystemRoot') . '\temp'; } - if (($var=$_ENV['TMPDIR']) || $var=getenv('TMPDIR')) { - return $var; + if ($var = isset($_ENV['TMPDIR']) ? $_ENV['TMPDIR'] : getenv('TMPDIR')) { + return $var; } return '/tmp'; } - /** - * (pajoye) Removed, problem with php.ini-recommanded, E removed - * - * (cox) I always get $_ENV empty in both Windows and Linux - * with all PHP version <= 4.2.1 - - function _myenv($var) - { - if (!empty($_ENV)) { - return isset($_ENV[$var]) ? $_ENV[$var] : false; - } - return getenv($var); - } - */ - /** * The "type" command (show the full path of a command) *