* 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
This commit is contained in:
Cliff Woolley 2002-05-17 05:16:18 +00:00
parent 3d4d3e3330
commit 78cac2a42e

View File

@ -83,6 +83,30 @@ static const char *php_apache_admin_value_handler(cmd_parms *cmd, void *dummy, c
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 @@ const command_rec php_dir_cmds[] =
{
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}