]> granicus.if.org Git - php/commitdiff
MFH:- Added php_ini_loaded_file() function which returns the path to the actual
authorfoobar <sniper@php.net>
Sat, 9 Jun 2007 11:44:08 +0000 (11:44 +0000)
committerfoobar <sniper@php.net>
Sat, 9 Jun 2007 11:44:08 +0000 (11:44 +0000)
  php.ini in use.

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

diff --git a/NEWS b/NEWS
index 7f299024ff001cac649ad75764e5d46a417c5f08..1fbaf6ce8ef14bd5079403f168329f9dec486323 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ PHP                                                                        NEWS
 ?? ??? 2007, PHP 5.2.4
 - Improved fix for MOPB-03-2007. (Ilia)
 - Corrected fix for CVE-2007-2872. (Ilia)
+- Added php_ini_loaded_file() function which returns the path to the actual
+  php.ini in use. (Jani)
 - Added GD version constants GD_MAJOR_VERSION, GD_MINOR_VERSION
   GD_RELEASE_VERSION, GD_EXTRA_VERSION and GD_VERSION_STRING. (Pierre)
 - Added missing open_basedir checks to CGI. (anight at eyelinkmedia dot com, 
index fe060e29de4dd274af1dfcd3f764c522cc470d8e..d81c0868a3891be17f0ff7babbbf637a16973064 100644 (file)
@@ -1765,6 +1765,10 @@ ZEND_END_ARG_INFO()
 static
 ZEND_BEGIN_ARG_INFO(arginfo_php_ini_scanned_files, 0)
 ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_php_ini_loaded_file, 0)
+ZEND_END_ARG_INFO()
 /* }}} */
 /* {{{ iptc.c */
 static
@@ -3132,6 +3136,7 @@ zend_function_entry basic_functions[] = {
        PHP_FE(php_sapi_name,                                                                                                   arginfo_php_sapi_name)
        PHP_FE(php_uname,                                                                                                               arginfo_php_uname)
        PHP_FE(php_ini_scanned_files,                                                                                   arginfo_php_ini_scanned_files)
+       PHP_FE(php_ini_loaded_file,                                                                                             arginfo_php_ini_loaded_file)
 
        PHP_FE(strnatcmp,                                                                                                               arginfo_strnatcmp)
        PHP_FE(strnatcasecmp,                                                                                                   arginfo_strnatcasecmp)
index eb587366a0e212dcc213da50115755270435bc53..878e832c674bb8d422302744fc8065cc95413def 100644 (file)
@@ -1170,6 +1170,18 @@ PHP_FUNCTION(php_ini_scanned_files)
 }
 /* }}} */
 
+/* {{{ proto string php_ini_loaded_file(void)
+   Return the actual loaded ini filename */
+PHP_FUNCTION(php_ini_loaded_file)
+{
+       if (php_ini_opened_path) {
+               RETURN_STRING(php_ini_opened_path, 1);
+       } else {
+               RETURN_FALSE;
+       }
+}
+/* }}} */
+
 /*
  * Local variables:
  * tab-width: 4
index 71ab2a51cb25b951c2e406df356d53a8e3046710..a54d0e2460ce0625b5ba3afb71f543e395cf6f7d 100644 (file)
@@ -66,6 +66,7 @@ PHP_FUNCTION(php_egg_logo_guid);
 PHP_FUNCTION(php_sapi_name);
 PHP_FUNCTION(php_uname);
 PHP_FUNCTION(php_ini_scanned_files);
+PHP_FUNCTION(php_ini_loaded_file);
 PHPAPI char *php_info_html_esc(char *string TSRMLS_DC);
 PHPAPI void php_info_html_esc_write(char *string, int str_len TSRMLS_DC);
 PHPAPI void php_print_info_htmlhead(TSRMLS_D);