cvs: php4 /sapi/apache2filter apache_config.c
| From: | Cliff Woolley | Date: | Fri, 17 May 2002 05:16:24 +0000 |
| Subject: | cvs: php4 /sapi/apache2filter apache_config.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-11967@lists.php.net to get a copy of this message | ||
jwoolley Fri May 17 01:16:24 2002 EDT
Modified files:
/php4/sapi/apache2filter apache_config.c
Log:
* restore the php_flag and php_admin_flag Apache directives which for
some mysterious reason never made their way from sapi/apache to
sapi/apache2filter when it was first written PR: 16629
* change the allowed locations of php_admin_value (and php_admin_flag to
match) to ACCESS_CONF instead of OR_NONE to match sapi/apache. No
idea why it was ever OR_NONE. PR: 16489
Index: php4/sapi/apache2filter/apache_config.c
diff -u php4/sapi/apache2filter/apache_config.c:1.20 php4/sapi/apache2filter/apache_config.c:1.21
--- php4/sapi/apache2filter/apache_config.c:1.20 Mon May 13 15:22:27 2002
+++ php4/sapi/apache2filter/apache_config.c Fri May 17 01:16:18 2002
@@ -83,6 +83,30 @@
return real_value_hnd(cmd, dummy, name, value, PHP_INI_SYSTEM);
}
+static const char *real_flag_hnd(cmd_parms *cmd, void *dummy, const char *arg1, const char *arg2,
int status)
+{
+ char bool_val[2];
+
+ if (!strcasecmp(arg2, "On")) {
+ bool_val[0] = '1';
+ } else {
+ bool_val[0] = '0';
+ }
+ bool_val[1] = 0;
+
+ return real_value_hnd(cmd, dummy, arg1, bool_val, status);
+}
+
+static const char *php_apache_flag_handler(cmd_parms *cmd, void *dummy, const char *name, const
char *value)
+{
+ return real_flag_hnd(cmd, dummy, name, value, PHP_INI_USER);
+}
+
+static const char *php_apache_admin_flag_handler(cmd_parms *cmd, void *dummy, const char *name,
const char *value)
+{
+ return real_flag_hnd(cmd, dummy, name, value, PHP_INI_SYSTEM);
+}
+
static const char *php_apache_phpini_set(cmd_parms *cmd, void *mconfig, const char *arg)
{
if (apache2_php_ini_path_override) {
@@ -139,8 +163,12 @@
{
AP_INIT_TAKE2("php_value", php_apache_value_handler, NULL, OR_OPTIONS,
"PHP Value Modifier"),
- AP_INIT_TAKE2("php_admin_value", php_apache_admin_value_handler, NULL, OR_NONE,
- "PHP Value Modifier"),
+ AP_INIT_TAKE2("php_flag", php_apache_flag_handler, NULL, OR_OPTIONS,
+ "PHP Flag Modifier"),
+ AP_INIT_TAKE2("php_admin_value", php_apache_admin_value_handler, NULL, ACCESS_CONF,
+ "PHP Value Modifier (Admin)"),
+ AP_INIT_TAKE2("php_admin_flag", php_apache_admin_flag_handler, NULL, ACCESS_CONF,
+ "PHP Flag Modifier (Admin)"),
AP_INIT_TAKE1("PHPINIDir", php_apache_phpini_set, NULL, RSRC_CONF,
"Directory containing the php.ini file"),
{NULL}