From b51b6f0fbfe7b405e49c203bea412f18846a969b Mon Sep 17 00:00:00 2001 From: Harald Radi Date: Sun, 19 Jan 2003 12:18:46 +0000 Subject: ini patch to allow 'entry[] = value' entries --- main/php_ini.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'main/php_ini.c') diff --git a/main/php_ini.c b/main/php_ini.c index 8c2a57e049..e0f6f6c098 100644 --- a/main/php_ini.c +++ b/main/php_ini.c @@ -195,6 +195,34 @@ static void php_config_ini_parser_cb(zval *arg1, zval *arg2, int callback_type, } } break; + + case ZEND_INI_PARSER_POP_ENTRY: { + zval *hash; + zval **find_hash; + zval *element; + + if (!arg2) { + /* bare string - nothing to do */ + break; + } + + if (zend_hash_find(&configuration_hash, Z_STRVAL_P(arg1), Z_STRLEN_P(arg1)+1, (void **) &find_hash) == FAILURE) { + ALLOC_ZVAL(hash); + array_init(hash); + + zend_hash_update(&configuration_hash, Z_STRVAL_P(arg1), Z_STRLEN_P(arg1)+1, &hash, sizeof(zval *), NULL); + } else { + hash = *find_hash; + } + + ALLOC_ZVAL(element); + *element = *arg2; + zval_copy_ctor(element); + INIT_PZVAL(element); + add_next_index_zval(hash, element); + } + break; + case ZEND_INI_PARSER_SECTION: break; } -- cgit v1.2.1