From: foobar Date: Sat, 9 Jun 2007 11:42:55 +0000 (+0000) Subject: - Added php_ini_loaded_file() function which returns the path to the actual X-Git-Tag: BEFORE_IMPORT_OF_MYSQLND~482 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=53b43a63cd1d66cc92fa5e1b45a830b9206a6901;p=php - Added php_ini_loaded_file() function which returns the path to the actual php.ini in use. # there was only a function to return the _additional_ files in use.. --- diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c index 0d42473bdf..ec87b2f772 100644 --- a/ext/standard/basic_functions.c +++ b/ext/standard/basic_functions.c @@ -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) diff --git a/ext/standard/info.c b/ext/standard/info.c index 2c9809051d..f4823d79bb 100644 --- a/ext/standard/info.c +++ b/ext/standard/info.c @@ -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 diff --git a/ext/standard/info.h b/ext/standard/info.h index 32ed936d48..5c10d65c20 100644 --- a/ext/standard/info.h +++ b/ext/standard/info.h @@ -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);