summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2007-06-09 11:44:08 +0000
committerfoobar <sniper@php.net>2007-06-09 11:44:08 +0000
commitf7d22b60f03ba0306e105feffb803ded42d00cda (patch)
tree15feca284545ea622b7b6af2710bc3309bfd12c1
parent1351bc4e86cbf2375bef99c8f068b7e8bc7788a6 (diff)
downloadphp-git-f7d22b60f03ba0306e105feffb803ded42d00cda.tar.gz
MFH:- Added php_ini_loaded_file() function which returns the path to the actual
php.ini in use.
-rw-r--r--NEWS2
-rw-r--r--ext/standard/basic_functions.c5
-rw-r--r--ext/standard/info.c12
-rw-r--r--ext/standard/info.h1
4 files changed, 20 insertions, 0 deletions
diff --git a/NEWS b/NEWS
index 7f299024ff..1fbaf6ce8e 100644
--- 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,
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index fe060e29de..d81c0868a3 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -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)
diff --git a/ext/standard/info.c b/ext/standard/info.c
index eb587366a0..878e832c67 100644
--- a/ext/standard/info.c
+++ b/ext/standard/info.c
@@ -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
diff --git a/ext/standard/info.h b/ext/standard/info.h
index 71ab2a51cb..a54d0e2460 100644
--- a/ext/standard/info.h
+++ b/ext/standard/info.h
@@ -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);