]> granicus.if.org Git - php/commitdiff
Added php_get_tmpdir() function that returns the default directory for
authorHartmut Holzgraefe <hholzgra@php.net>
Sat, 6 May 2006 09:59:02 +0000 (09:59 +0000)
committerHartmut Holzgraefe <hholzgra@php.net>
Sat, 6 May 2006 09:59:02 +0000 (09:59 +0000)
temporary files (as requested in bug #35380)

NEWS
ext/standard/basic_functions.c
ext/standard/file.c
ext/standard/file.h

diff --git a/NEWS b/NEWS
index 25428a3d28fc58629a183b1cbdaceeae9d896460..f12fc06814d322e8029b344aa2e5587d474bcfc3 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -52,6 +52,8 @@ PHP                                                                        NEWS
   defined using reflection API. (Johannes)
 - Added second optional parameter to stream_context_create() to set params
   during context creation. (Sara)
+- Added php_get_tmpdir() function that returns the default directory for
+  temporary files (as requested in bug #35380). (Hartmut)
 
 - Fixed bug #36630 (umask not reset at the end of the request). (Ilia)
 - Fixed bug #34286 (__toString() behavior is inconsistent). (Marcus)
index 9b9f935f59cf43ee68bae06f7a957752a3a044e2..202234f6368a75dee33c078359c3d9f32f2edbf8 100644 (file)
@@ -846,6 +846,8 @@ zend_function_entry basic_functions[] = {
        PHP_FE(output_add_rewrite_var,                                                                                  NULL)
        PHP_FE(output_reset_rewrite_vars,                                                                               NULL)
 
+       PHP_FE(php_get_tmpdir,                                          NULL)
+
        {NULL, NULL, NULL}
 };
 
index e1adbe8aa7955198e4003851b539be3845bd604b..adf86f2cdab9c731d63432acdd70654cb73999e8 100644 (file)
@@ -2555,6 +2555,14 @@ PHP_FUNCTION(fnmatch)
 /* }}} */
 #endif
 
+/* {{{ proto string php_get_tmpdir()
+   Returns directory path used for temporary files */
+PHP_FUNCTION(php_get_tmpdir)
+{
+       RETURN_STRING((char *)php_get_temporary_directory(), 1);
+}
+/* }}} */
+
 /*
  * Local variables:
  * tab-width: 4
index 2d3afb121473cf61e29123adcacb7210b8cf9886..38ae583d7d6d3bb3730ba34624f38c5b56d6ef71 100644 (file)
@@ -66,6 +66,7 @@ PHP_FUNCTION(fnmatch);
 #endif
 PHP_NAMED_FUNCTION(php_if_ftruncate);
 PHP_NAMED_FUNCTION(php_if_fstat);
+PHP_FUNCTION(php_get_tmpdir);
 
 PHP_MINIT_FUNCTION(user_streams);