diff options
| author | Michael Wallner <mike@php.net> | 2006-06-09 16:29:35 +0000 |
|---|---|---|
| committer | Michael Wallner <mike@php.net> | 2006-06-09 16:29:35 +0000 |
| commit | 76838bcd5466a6c2e70986ade3bc5e6df11754f6 (patch) | |
| tree | f4802297d6f9340ab57ed160d1ae3a09c6698513 /sapi/apache2filter | |
| parent | 96724797c832d8c6580c89d581544d89f5e94522 (diff) | |
| download | php-git-76838bcd5466a6c2e70986ade3bc5e6df11754f6.tar.gz | |
- sync with apache2handler
Diffstat (limited to 'sapi/apache2filter')
| -rw-r--r-- | sapi/apache2filter/apache_config.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/sapi/apache2filter/apache_config.c b/sapi/apache2filter/apache_config.c index a77a6b5714..46d286e1df 100644 --- a/sapi/apache2filter/apache_config.c +++ b/sapi/apache2filter/apache_config.c @@ -128,28 +128,31 @@ static const char *php_apache_phpini_set(cmd_parms *cmd, void *mconfig, void *merge_php_config(apr_pool_t *p, void *base_conf, void *new_conf) { - php_conf_rec *d = base_conf, *e = new_conf; + php_conf_rec *d = base_conf, *e = new_conf, *n = NULL; php_dir_entry *pe; php_dir_entry *data; char *str; uint str_len; ulong num_index; - phpapdebug((stderr, "Merge dir (%p) (%p)\n", base_conf, new_conf)); + n = create_php_config(p, "merge_php_config"); + zend_hash_copy(&n->config, &e->config, NULL, NULL, sizeof(php_dir_entry)); + + phpapdebug((stderr, "Merge dir (%p)+(%p)=(%p)\n", base_conf, new_conf, n)); for (zend_hash_internal_pointer_reset(&d->config); zend_hash_get_current_key_ex(&d->config, &str, &str_len, &num_index, 0, NULL) == HASH_KEY_IS_STRING; zend_hash_move_forward(&d->config)) { pe = NULL; zend_hash_get_current_data(&d->config, (void **) &data); - if (zend_hash_find(&e->config, str, str_len, (void **) &pe) == SUCCESS) { + if (zend_hash_find(&n->config, str, str_len, (void **) &pe) == SUCCESS) { 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)); + zend_hash_update(&n->config, str, str_len, data, sizeof(*data), NULL); + phpapdebug((stderr, "ADDING/OVERWRITING %s (%d vs. %d)\n", str, data->status, pe?pe->status:-1)); } - return new_conf; + + return n; } char *get_php_config(void *conf, char *name, size_t name_len) |
