[Fusionforge-commits] r12125 - trunk/src/common/include

Alain Peyrat aljeux at libremir.placard.fr.eu.org
Mon Jan 31 19:52:11 CET 2011


Author: aljeux
Date: 2011-01-31 19:52:11 +0100 (Mon, 31 Jan 2011)
New Revision: 12125

Modified:
   trunk/src/common/include/utils.php
Log:
Fix missing sys_get_temp_dir() is only available for PHP >= 5.2.1

Modified: trunk/src/common/include/utils.php
===================================================================
--- trunk/src/common/include/utils.php	2011-01-31 18:50:52 UTC (rev 12124)
+++ trunk/src/common/include/utils.php	2011-01-31 18:52:11 UTC (rev 12125)
@@ -1398,6 +1398,16 @@
 	return ($min + $v);
 }
 
+// sys_get_temp_dir() is only available for PHP >= 5.2.1
+if ( !function_exists('sys_get_temp_dir')) {
+	function sys_get_temp_dir() {
+		if ($temp=getenv('TMP'))    return $temp;
+		if ($temp=getenv('TEMP'))   return $temp;
+		if ($temp=getenv('TMPDIR')) return $temp;
+		return '/tmp';
+	}
+}
+
 // Local Variables:
 // mode: php
 // c-file-style: "bsd"




More information about the Fusionforge-commits mailing list