PHP_METHOD(HTTPi_Request, unsetOptions)
{
getObject(httpi_request_object, obj);
-
+
NO_ARGS;
-
+
FREE_PARR(obj, options);
INIT_PARR(obj, options);
}
{
zval *opts, **headers, *new_headers;
getObject(httpi_request_object, obj);
-
+
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &new_headers)) {
RETURN_FALSE;
}
-
+
opts = GET_PROP(obj, options);
-
+
if (SUCCESS == zend_hash_find(Z_ARRVAL_P(opts), "headers", sizeof("headers"), (void **) &headers)) {
array_merge(new_headers, *headers);
} else {
- zval_add_ref(new_headers);
+ zval_add_ref(&new_headers);
add_assoc_zval(opts, "headers", new_headers);
}
-
+
RETURN_TRUE;
}
/* }}} */
{
zval *opts, **cookies, *new_cookies;
getObject(httpi_request_object, obj);
-
+
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &new_cookies)) {
RETURN_FALSE;
}
-
+
opts = GET_PROP(obj, options);
-
+
if (SUCCESS == zend_hash_find(Z_ARRVAL_P(opts), "cookies", sizeof("cookies"), (void **) &cookies)) {
array_merge(new_cookies, *cookies);
} else {
- zval_add_ref(new_cookies);
+ zval_add_ref(&new_cookies);
add_assoc_zval(opts, "cookies", new_cookies);
}
-
+
RETURN_TRUE;
}
/* }}} */