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 Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
17 - 1 = ?
Subscribe to this entry?

 
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2019 The PHP Group
All rights reserved.
Last updated: Sun Dec 15 00:01:22 2019 UTC