]> granicus.if.org Git - php/commitdiff
- Added php_ini_loaded_file() function which returns the path to the actual
authorfoobar <sniper@php.net>
Sat, 9 Jun 2007 11:42:55 +0000 (11:42 +0000)
committerfoobar <sniper@php.net>
Sat, 9 Jun 2007 11:42:55 +0000 (11:42 +0000)
  php.ini in use.
# there was only a function to return the _additional_ files in use..

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

index 0d42473bdf2b6761f3789cd57a9e422aa06a4de7..ec87b2f7720f0907c9302c18507d12a42b635d0d 100644 (file)
@@ -1756,6 +1756,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
@@ -3172,6 +3176,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 2c9809051de43565a69feeb6194b8cca2b3a20e9..f4823d79bbff56e5fafba702587ae0d43dc30cc8 100644 (file)
@@ -1107,6 +1107,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 32ed936d486f6dcb24ddb141c15d1331328b32ed..5c10d65c20a810c9d7cf9800da62beb843ab4a29 100644 (file)
@@ -66,6 +66,8 @@ 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);
+
 /* NOTE: use UTF-8 if you print anything non-ASCII */
 PHPAPI char *php_info_html_esc(char *string TSRMLS_DC);
 PHPAPI void php_print_info_htmlhead(TSRMLS_D);