]> granicus.if.org Git - php/commitdiff
MFH: sys_get_temp_dir()
authorHannes Magnusson <bjori@php.net>
Sat, 9 Dec 2006 18:00:52 +0000 (18:00 +0000)
committerHannes Magnusson <bjori@php.net>
Sat, 9 Dec 2006 18:00:52 +0000 (18:00 +0000)
NEWS
ext/standard/basic_functions.c
ext/standard/file.c
ext/standard/file.h

diff --git a/NEWS b/NEWS
index 36771459c73d26aeaddf36a6db9d8a5d4907af7f..1890dbc23ba038dcaa8271d73ce34edafb32ef37 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,7 @@ PHP                                                                        NEWS
 ?? ??? 2007, PHP 5.2.1
 - Added a meta tag to phpinfo() output to prevent search engines from indexing 
   the page. (Ilia)
+- Added new function, sys_get_temp_dir(). (Hartmut)
 - Added missing object support to file_put_contents(). (Ilia)
 - Changed double-to-string utilities to use BSD implementation. (Dmitry, Tony)
 - Updated bundled libcURL to version 7.16.0 in the Windows distro. (Edin)
index 69b816d2266eb7b5e7adb37106dd5c791978de62..a61d7c70346d23c8c7a2a87244d1bd01869c11fc 100644 (file)
@@ -1399,6 +1399,9 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_fnmatch, 0, 0, 2)
        ZEND_ARG_INFO(0, flags)
 ZEND_END_ARG_INFO()
 #endif
+static
+ZEND_BEGIN_ARG_INFO(arginfo_sys_get_temp_dir, 0)
+ZEND_END_ARG_INFO()
 /* }}} */
 /* {{{ filestat.c */
 static
@@ -3762,6 +3765,7 @@ zend_function_entry basic_functions[] = {
        PHP_FE(output_add_rewrite_var,                                                                                  arginfo_output_add_rewrite_var)
        PHP_FE(output_reset_rewrite_vars,                                                                               arginfo_output_reset_rewrite_vars)
 
+       PHP_FE(sys_get_temp_dir,                                                                                                arginfo_sys_get_temp_dir)
        {NULL, NULL, NULL}
 };
 
index 83fd20839d9ccf10137bfbd6efd140e4493d1621..6c98b541a899a231b64820bace54b53035b8a396 100644 (file)
@@ -2503,6 +2503,14 @@ PHP_FUNCTION(fnmatch)
 /* }}} */
 #endif
 
+/* {{{ proto string sys_get_temp_dir()
+   Returns directory path used for temporary files */
+PHP_FUNCTION(sys_get_temp_dir)
+{
+       RETURN_STRING((char *)php_get_temporary_directory(), 1);
+}
+/* }}} */
+
 /*
  * Local variables:
  * tab-width: 4
index 7a2fde1e22baebdb78ee5ada59f412f5343ee4af..ab514aa85ddfc0020c3b79c7c177d3003c4f40cc 100644 (file)
@@ -66,6 +66,7 @@ PHP_FUNCTION(fnmatch);
 #endif
 PHP_NAMED_FUNCTION(php_if_ftruncate);
 PHP_NAMED_FUNCTION(php_if_fstat);
+PHP_FUNCTION(sys_get_temp_dir);
 
 PHP_MINIT_FUNCTION(user_streams);