php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #58702 simple detection of tmpdir
Submitted: 2009-05-22 22:49 UTC Modified: 2009-05-26 11:11 UTC
From: guenter@php.net Assigned:
Status: Closed Package: uploadprogress (PECL)
PHP Version: 5.2.9 OS: all
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: guenter@php.net
New email:
PHP Version: OS:

 

 [2009-05-22 22:49 UTC] guenter@php.net
Description:
------------
I think we could make use of P_tmpdir define if available to preset the tmpdir properly depending on the system.


Reproduce code:
---------------
--- uploadprogress.c.orig	Sun Mar 15 20:41:46 2009
+++ uploadprogress.c	Fri May 22 17:28:28 2009
@@ -25,6 +25,12 @@
 
 #if HAVE_UPLOADPROGRESS
 
+#ifdef P_tmpdir
+#define TMPDIR P_tmpdir
+#else
+#define TMPDIR "/tmp"
+#endif
+
 /* {{{ uploadprogress_functions[] */
 function_entry uploadprogress_functions[] = {
     PHP_FE(uploadprogress_get_info, NULL)
@@ -34,9 +40,9 @@
 /* }}} */
 
 PHP_INI_BEGIN()
-PHP_INI_ENTRY("uploadprogress.file.filename_template",    "/tmp/upt_%s.txt",            PHP_INI_ALL,    NULL)
-PHP_INI_ENTRY("uploadprogress.file.contents_template",    "/tmp/upload_contents_%s",    PHP_INI_ALL,    NULL)
-PHP_INI_ENTRY("uploadprogress.get_contents",            "0",                        PHP_INI_ALL,    NULL)
+PHP_INI_ENTRY("uploadprogress.file.filename_template", TMPDIR "/upt_%s.txt",         PHP_INI_ALL, NULL)
+PHP_INI_ENTRY("uploadprogress.file.contents_template", TMPDIR "/upload_contents_%s", PHP_INI_ALL, NULL)
+PHP_INI_ENTRY("uploadprogress.get_contents",           "0",                          PHP_INI_ALL, NULL)
 PHP_INI_END()
 
 /* {{{ uploadprogress_module_entry



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-05-26 11:11 UTC] chregu@php.net
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.

Applied and committed to cvs. thx
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 26 12:01:30 2024 UTC