logo       

cvs: php4 /pear System.php: msg#00537

Subject: cvs: php4 /pear System.php
pajoye          Thu Aug 29 06:08:37 2002 EDT

  Modified files:              
    /php4/pear  System.php 
  Log:
  Hope to finnally got it, fixes notice (Thx to Sebastian)
  
  
Index: php4/pear/System.php
diff -u php4/pear/System.php:1.19 php4/pear/System.php:1.20
--- php4/pear/System.php:1.19   Sun Aug 25 20:18:00 2002
+++ php4/pear/System.php        Thu Aug 29 06:08:37 2002
@@ -16,7 +16,7 @@
 // | Authors: Tomas V.V.Cox <cox@xxxxxxxxxxx>                             |
 // +----------------------------------------------------------------------+
 //
-// $Id: System.php,v 1.19 2002/08/26 00:18:00 pajoye Exp $
+// $Id: System.php,v 1.20 2002/08/29 10:08:37 pajoye Exp $
 //
 
 require_once 'PEAR.php';
@@ -43,7 +43,7 @@
 *
 * @package  System
 * @author   Tomas V.V.Cox <cox@xxxxxxxxxxx>
-* @version  $Revision: 1.19 $
+* @version  $Revision: 1.20 $
 * @access   public
 * @see      http://pear.php.net/manual/
 */
@@ -385,43 +385,30 @@
     /**
     * 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)



-- 
PEAR CVS Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
science.linguis...    culture.sf.lite...    video.mplayer.c...    yellowdog.gener...    ietf.rfc822/199...    emacs.help/2002...    redhat.release....    kernel.speakup/...    java.openejb.de...    debian.devel.gt...    xfree86.newbie/...    bug-tracking.ma...    pam/2003-05/msg...    games.devel.ope...    user-groups.lin...    music.pancham/2...    network.mq.deve...    web.html.genera...    arklinux.bugs/2...    linux.ecasound/...    qnx.openqnx.dev...    org.user-groups...    file-systems.sf...    trustix.contrib...   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe