summaryrefslogtreecommitdiff
path: root/main/php_ini.c
diff options
context:
space:
mode:
authorHarald Radi <phanto@php.net>2003-01-19 12:18:46 +0000
committerHarald Radi <phanto@php.net>2003-01-19 12:18:46 +0000
commitb51b6f0fbfe7b405e49c203bea412f18846a969b (patch)
tree80d1ac40fbe6506bf30ff83a808a42fbfd0aa019 /main/php_ini.c
parent697398e18ec87060f1f62a96e6e666d326eda0a9 (diff)
downloadphp-git-b51b6f0fbfe7b405e49c203bea412f18846a969b.tar.gz
ini patch to allow 'entry[] = value' entries
Diffstat (limited to 'main/php_ini.c')
-rw-r--r--main/php_ini.c28
1 files changed, 28 insertions, 0 deletions
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;
}