summaryrefslogtreecommitdiff
path: root/sapi/apache2handler/apache_config.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2003-03-07 13:45:33 +0000
committerIlia Alshanetsky <iliaa@php.net>2003-03-07 13:45:33 +0000
commit97418f59bdcea39dc2d2c2d50d37c7144b508db4 (patch)
treefccbcbced71a0a997987ce0dbeafdb2d5ac59518 /sapi/apache2handler/apache_config.c
parentba18cd1a45bd969340e39a2676a1d92bc8fde17e (diff)
downloadphp-git-97418f59bdcea39dc2d2c2d50d37c7144b508db4.tar.gz
CS Fixes.
Fixed a bug with 404 handling. Added more detailed Apache info for phpinfo(). Added the support for last_modified.
Diffstat (limited to 'sapi/apache2handler/apache_config.c')
-rw-r--r--sapi/apache2handler/apache_config.c56
1 files changed, 19 insertions, 37 deletions
diff --git a/sapi/apache2handler/apache_config.c b/sapi/apache2handler/apache_config.c
index 3859653ce8..ee37a9df19 100644
--- a/sapi/apache2handler/apache_config.c
+++ b/sapi/apache2handler/apache_config.c
@@ -51,14 +51,12 @@ typedef struct {
char status;
} php_dir_entry;
-static const char *real_value_hnd(cmd_parms *cmd, void *dummy,
- const char *name, const char *value, int status)
+static const char *real_value_hnd(cmd_parms *cmd, void *dummy, const char *name, const char *value, int status)
{
php_conf_rec *d = dummy;
php_dir_entry e;
- phpapdebug((stderr, "Getting %s=%s for %p (%d)\n", name, value, dummy,
- zend_hash_num_elements(&d->config)));
+ phpapdebug((stderr, "Getting %s=%s for %p (%d)\n", name, value, dummy, zend_hash_num_elements(&d->config)));
if (!strncasecmp(value, "none", sizeof("none"))) {
value = "";
@@ -68,25 +66,21 @@ static const char *real_value_hnd(cmd_parms *cmd, void *dummy,
e.value_len = strlen(value);
e.status = status;
- zend_hash_update(&d->config, (char *) name, strlen(name) + 1, &e,
- sizeof(e), NULL);
+ zend_hash_update(&d->config, (char *) name, strlen(name) + 1, &e, sizeof(e), NULL);
return NULL;
}
-static const char *php_apache_value_handler(cmd_parms *cmd, void *dummy,
- const char *name, const char *value)
+static const char *php_apache_value_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value)
{
return real_value_hnd(cmd, dummy, name, value, PHP_INI_PERDIR);
}
-static const char *php_apache_admin_value_handler(cmd_parms *cmd, void *dummy,
- const char *name, const char *value)
+static const char *php_apache_admin_value_handler(cmd_parms *cmd, void *dummy, const char *name, const char *value)
{
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)
+static const char *real_flag_hnd(cmd_parms *cmd, void *dummy, const char *arg1, const char *arg2, int status)
{
char bool_val[2];
@@ -100,24 +94,20 @@ static const char *real_flag_hnd(cmd_parms *cmd, void *dummy, const char *arg1,
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)
+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_PERDIR);
}
-static const char *php_apache_admin_flag_handler(cmd_parms *cmd, void *dummy,
- const char *name, const char *value)
+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)
+static const char *php_apache_phpini_set(cmd_parms *cmd, void *mconfig, const char *arg)
{
if (apache2_php_ini_path_override) {
- return "Only first PHPINIDir directive honored per configuration tree "
- "- subsequent ones ignored";
+ return "Only first PHPINIDir directive honored per configuration tree - subsequent ones ignored";
}
apache2_php_ini_path_override = ap_server_root_relative(cmd->pool, arg);
return NULL;
@@ -144,8 +134,7 @@ void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf)
if (pe->status >= data->status) continue;
}
zend_hash_update(&e->config, str, str_len, data, sizeof(*data), NULL);
- phpapdebug((stderr, "ADDING/OVERWRITING %s (%d vs. %d)\n", str,
- data->status, pe?pe->status:-1));
+ phpapdebug((stderr, "ADDING/OVERWRITING %s (%d vs. %d)\n", str, data->status, pe?pe->status:-1));
}
return new_conf;
}
@@ -175,8 +164,7 @@ void apply_config(void *dummy)
zend_hash_move_forward(&d->config)) {
zend_hash_get_current_data(&d->config, (void **) &data);
phpapdebug((stderr, "APPLYING (%s)(%s)\n", str, data->value));
- if (zend_alter_ini_entry(str, str_len, data->value, data->value_len,
- data->status, PHP_INI_STAGE_RUNTIME) == FAILURE) {
+ if (zend_alter_ini_entry(str, str_len, data->value, data->value_len, data->status, PHP_INI_STAGE_RUNTIME) == FAILURE) {
phpapdebug((stderr, "..FAILED\n"));
}
}
@@ -184,17 +172,12 @@ void apply_config(void *dummy)
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_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|RSRC_CONF, "PHP Value Modifier (Admin)"),
- AP_INIT_TAKE2("php_admin_flag", php_apache_admin_flag_handler, NULL,
- ACCESS_CONF|RSRC_CONF, "PHP Flag Modifier (Admin)"),
- AP_INIT_TAKE1("PHPINIDir", php_apache_phpini_set, NULL, RSRC_CONF,
- "Directory containing the php.ini file"),
- {NULL}
+ AP_INIT_TAKE2("php_value", php_apache_value_handler, NULL, OR_OPTIONS, "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|RSRC_CONF, "PHP Value Modifier (Admin)"),
+ AP_INIT_TAKE2("php_admin_flag", php_apache_admin_flag_handler, NULL, ACCESS_CONF|RSRC_CONF, "PHP Flag Modifier (Admin)"),
+ AP_INIT_TAKE1("PHPINIDir", php_apache_phpini_set, NULL, RSRC_CONF, "Directory containing the php.ini file"),
+ {NULL}
};
static apr_status_t destroy_php_config(void *data)
@@ -209,8 +192,7 @@ static apr_status_t destroy_php_config(void *data)
void *create_php_config(apr_pool_t *p, char *dummy)
{
- php_conf_rec *newx =
- (php_conf_rec *) apr_pcalloc(p, sizeof(*newx));
+ php_conf_rec *newx = (php_conf_rec *) apr_pcalloc(p, sizeof(*newx));
phpapdebug((stderr, "Creating new config (%p) for %s\n", newx, dummy));
zend_hash_init(&newx->config, 0, NULL, NULL, 1);