From 29e1530cd778fa07d8cd3a742bf28c4ff7806cfc Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 3 Aug 2006 09:56:50 +0000 Subject: [PATCH] Added "PHPINIDir" Apache directive to apache and apache_hooks SAPIs --- NEWS | 1 + sapi/apache/mod_php5.c | 13 +++++++++++++ sapi/apache_hooks/mod_php5.c | 13 +++++++++++++ 3 files changed, 27 insertions(+) diff --git a/NEWS b/NEWS index a69402fa57..3c22676fc3 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,7 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? Aug 2006, PHP 5.2.0RC2 +- Added "PHPINIDir" Apache directive to apache and apache_hooks SAPIs. (Dmitry) - Added an optional boolean parameter to memory_get_usage() and memory_get_peak_usage() to get memory size allocated by emalloc() or real size of memory allocated from system. (Dmitry) diff --git a/sapi/apache/mod_php5.c b/sapi/apache/mod_php5.c index 12ae84b89e..a6d18f9705 100644 --- a/sapi/apache/mod_php5.c +++ b/sapi/apache/mod_php5.c @@ -863,6 +863,18 @@ static CONST_PREFIX char *php_apache_admin_flag_handler(cmd_parms *cmd, HashTabl } /* }}} */ +/* {{{ php_apache_phpini_set + */ +static CONST_PREFIX char *php_apache_phpini_set(cmd_parms *cmd, HashTable *conf, char *arg) +{ + if (apache_sapi_module.php_ini_path_override) { + return "Only first PHPINIDir directive honored per configuration tree - subsequent ones ignored"; + } + apache_sapi_module.php_ini_path_override = ap_server_root_relative(cmd->pool, arg); + return NULL; +} +/* }}} */ + /* {{{ int php_xbithack_handler(request_rec * r) */ static int php_xbithack_handler(request_rec * r) @@ -965,6 +977,7 @@ command_rec php_commands[] = {"php_flag", php_apache_flag_handler, NULL, OR_OPTIONS, TAKE2, "PHP Flag Modifier"}, {"php_admin_value", php_apache_admin_value_handler, NULL, ACCESS_CONF|RSRC_CONF, TAKE2, "PHP Value Modifier (Admin)"}, {"php_admin_flag", php_apache_admin_flag_handler, NULL, ACCESS_CONF|RSRC_CONF, TAKE2, "PHP Flag Modifier (Admin)"}, + {"PHPINIDir", php_apache_phpini_set, NULL, RSRC_CONF, TAKE1, "Directory containing the php.ini file"}, {NULL} }; /* }}} */ diff --git a/sapi/apache_hooks/mod_php5.c b/sapi/apache_hooks/mod_php5.c index fcdb4d44f7..7d46ce62d9 100644 --- a/sapi/apache_hooks/mod_php5.c +++ b/sapi/apache_hooks/mod_php5.c @@ -1160,6 +1160,18 @@ static CONST_PREFIX char *php_apache_admin_flag_handler(cmd_parms *cmd, php_per_ } /* }}} */ +/* {{{ php_apache_phpini_set + */ +static CONST_PREFIX char *php_apache_phpini_set(cmd_parms *cmd, HashTable *conf, char *arg) +{ + if (apache_sapi_module.php_ini_path_override) { + return "Only first PHPINIDir directive honored per configuration tree - subsequent ones ignored"; + } + apache_sapi_module.php_ini_path_override = ap_server_root_relative(cmd->pool, arg); + return NULL; +} +/* }}} */ + /* {{{ int php_xbithack_handler(request_rec * r) */ static int php_xbithack_handler(request_rec * r) @@ -1431,6 +1443,7 @@ command_rec php_commands[] = {"php_flag", php_apache_flag_handler, NULL, OR_OPTIONS, TAKE2, "PHP Flag Modifier"}, {"php_admin_value", php_apache_admin_value_handler, NULL, ACCESS_CONF|RSRC_CONF, TAKE2, "PHP Value Modifier (Admin)"}, {"php_admin_flag", php_apache_admin_flag_handler, NULL, ACCESS_CONF|RSRC_CONF, TAKE2, "PHP Flag Modifier (Admin)"}, + {"PHPINIDir", php_apache_phpini_set, NULL, RSRC_CONF, TAKE1, "Directory containing the php.ini file"}, {NULL} }; /* }}} */ -- 2.50.1