{
if (overwrite || (opts && zend_hash_num_elements(Z_ARRVAL_P(opts)))) {
zend_class_entry *this_ce = Z_OBJCE_P(instance);
- zval *old_opts, new_opts, *entry = NULL;
+ zval old_opts_tmp, *old_opts, new_opts, *entry = NULL;
array_init(&new_opts);
- old_opts = zend_read_property(this_ce, instance, ZEND_STRL("options"), 0);
+ old_opts = zend_read_property(this_ce, instance, ZEND_STRL("options"), 0, &old_opts_tmp);
if (Z_TYPE_P(old_opts) == IS_ARRAY) {
array_copy(Z_ARRVAL_P(old_opts), Z_ARRVAL(new_opts));
}
zend_update_property(this_ce, instance, ZEND_STRL("options"), &new_opts);
zval_ptr_dtor(&new_opts);
} else {
- zval *old_opts, add_opts, *opt;
+ zval old_opts_tmp, *old_opts, add_opts, *opt;
array_init(&add_opts);
/* some options need extra attention -- thus cannot use array_merge() directly */
} else if (is_client && (zend_string_equals_literal(key.key, "recordHistory") || zend_string_equals_literal(key.key, "responseMessageClass"))) {
zend_update_property(this_ce, instance, key.key->val, key.key->len, opt);
} else if (Z_TYPE_P(opt) == IS_NULL) {
- old_opts = zend_read_property(this_ce, instance, ZEND_STRL("options"), 0);
+ old_opts = zend_read_property(this_ce, instance, ZEND_STRL("options"), 0, &old_opts_tmp);
if (Z_TYPE_P(old_opts) == IS_ARRAY) {
zend_symtable_del(Z_ARRVAL_P(old_opts), key.key);
}
}
ZEND_HASH_FOREACH_END();
- old_opts = zend_read_property(this_ce, instance, ZEND_STRL("options"), 0);
+ old_opts = zend_read_property(this_ce, instance, ZEND_STRL("options"), 0, &old_opts_tmp);
if (Z_TYPE_P(old_opts) == IS_ARRAY) {
array_copy(Z_ARRVAL_P(old_opts), Z_ARRVAL(new_opts));
}
void php_http_client_options_get_subr(zval *instance, char *key, size_t len, zval *return_value)
{
zend_class_entry *this_ce = Z_OBJCE_P(instance);
- zval *options, *opts = zend_read_property(this_ce, instance, ZEND_STRL("options"), 0);
+ zval *options, opts_tmp, *opts = zend_read_property(this_ce, instance, ZEND_STRL("options"), 0, &opts_tmp);
if ((Z_TYPE_P(opts) == IS_ARRAY) && (options = zend_symtable_str_find(Z_ARRVAL_P(opts), key, len))) {
RETVAL_ZVAL_FAST(options);
static void handle_history(zval *zclient, php_http_message_t *request, php_http_message_t *response)
{
- zval new_hist, *old_hist = zend_read_property(php_http_client_class_entry, zclient, ZEND_STRL("history"), 0);
+ zval new_hist, old_hist_tmp, *old_hist = zend_read_property(php_http_client_class_entry, zclient, ZEND_STRL("history"), 0, &old_hist_tmp);
php_http_message_t *req_copy = php_http_message_copy(request, NULL);
php_http_message_t *res_copy = php_http_message_copy(response, NULL);
php_http_message_t *zipped = php_http_message_zip(res_copy, req_copy);
if ((msg = *response)) {
php_http_message_object_t *msg_obj;
- zval info, zresponse, zrequest;
+ zval info, zresponse, zrequest, rec_hist_tmp;
HashTable *info_ht;
/* ensure the message is of type response (could be uninitialized in case of early error, like DNS) */
php_http_message_set_type(msg, PHP_HTTP_RESPONSE);
- if (zend_is_true(zend_read_property(php_http_client_class_entry, &zclient, ZEND_STRL("recordHistory"), 0))) {
+ if (zend_is_true(zend_read_property(php_http_client_class_entry, &zclient, ZEND_STRL("recordHistory"), 0, &rec_hist_tmp))) {
handle_history(&zclient, *request, *response);
}
{
HashTable *options;
unsigned num_options = 0;
- zval z_roptions, *z_coptions = zend_read_property(php_http_client_class_entry, client, ZEND_STRL("options"), 0);
+ zval z_roptions, z_options_tmp, *z_coptions = zend_read_property(php_http_client_class_entry, client, ZEND_STRL("options"), 0, &z_options_tmp);
if (Z_TYPE_P(z_coptions) == IS_ARRAY) {
num_options = zend_hash_num_elements(Z_ARRVAL_P(z_coptions));
ZEND_END_ARG_INFO();
static PHP_METHOD(HttpClient, getHistory)
{
- zval *zhistory;
+ zval zhistory_tmp, *zhistory;
php_http_expect(SUCCESS == zend_parse_parameters_none(), invalid_arg, return);
- zhistory = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("history"), 0);
+ zhistory = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("history"), 0, &zhistory_tmp);
RETVAL_ZVAL_FAST(zhistory);
}
ZEND_END_ARG_INFO();
static PHP_METHOD(HttpClient, notify)
{
- zval *request = NULL, *zprogress = NULL, *observers, args[3];
+ zval *request = NULL, *zprogress = NULL, observers_tmp, *observers, args[3];
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|O!o!", &request, php_http_client_request_class_entry, &zprogress), invalid_arg, return);
- observers = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("observers"), 0);
+ observers = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("observers"), 0, &observers_tmp);
if (Z_TYPE_P(observers) != IS_OBJECT) {
php_http_throw(unexpected_val, "Observer storage is corrupted", NULL);
ZEND_END_ARG_INFO();
static PHP_METHOD(HttpClient, attach)
{
- zval *observers, *observer, retval;
+ zval observers_tmp, *observers, *observer, retval;
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "O", &observer, spl_ce_SplObserver), invalid_arg, return);
- observers = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("observers"), 0);
+ observers = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("observers"), 0, &observers_tmp);
if (Z_TYPE_P(observers) != IS_OBJECT) {
php_http_throw(unexpected_val, "Observer storage is corrupted", NULL);
ZEND_END_ARG_INFO();
static PHP_METHOD(HttpClient, detach)
{
- zval *observers, *observer, retval;
+ zval observers_tmp, *observers, *observer, retval;
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "O", &observer, spl_ce_SplObserver), invalid_arg, return);
- observers = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("observers"), 0);
+ observers = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("observers"), 0, &observers_tmp);
if (Z_TYPE_P(observers) != IS_OBJECT) {
php_http_throw(unexpected_val, "Observer storage is corrupted", NULL);
ZEND_END_ARG_INFO();
static PHP_METHOD(HttpClient, getObservers)
{
- zval *observers;
+ zval observers_tmp, *observers;
php_http_expect(SUCCESS == zend_parse_parameters_none(), invalid_arg, return);
- observers = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("observers"), 0);
+ observers = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("observers"), 0, &observers_tmp);
if (Z_TYPE_P(observers) != IS_OBJECT) {
php_http_throw(unexpected_val, "Observer storage is corrupted", NULL);
static PHP_METHOD(HttpClient, getOptions)
{
if (SUCCESS == zend_parse_parameters_none()) {
- zval *options = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("options"), 0);
+ zval options_tmp, *options = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("options"), 0, &options_tmp);
RETVAL_ZVAL_FAST(options);
}
}
static ZEND_RESULT_CODE php_http_curle_get_info(CURL *ch, HashTable *info)
{
- char *c;
- long l;
- double d;
- struct curl_slist *s, *p;
- zval tmp;
+ char *c = NULL;
+ long l = 0;
+ double d = 0;
+ struct curl_slist *s = NULL, *p = NULL;
+ zval tmp = {{0}};
/* BEGIN::CURLINFO */
if (CURLE_OK == curl_easy_getinfo(ch, CURLINFO_EFFECTIVE_URL, &c)) {
static PHP_METHOD(HttpClientRequest, getOptions)
{
if (SUCCESS == zend_parse_parameters_none()) {
- zval *zoptions = zend_read_property(php_http_client_request_class_entry, getThis(), ZEND_STRL("options"), 0);
+ zval tmp, *zoptions = zend_read_property(php_http_client_request_class_entry, getThis(), ZEND_STRL("options"), 0, &tmp);
RETURN_ZVAL_FAST(zoptions);
}
}
{
char *info_name = NULL;
size_t info_len = 0;
- zval *info;
+ zval info_tmp, info_name_tmp, *info;
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "|s", &info_name, &info_len), invalid_arg, return);
- info = zend_read_property(php_http_client_response_class_entry, getThis(), ZEND_STRL("transferInfo"), 0);
+ info = zend_read_property(php_http_client_response_class_entry, getThis(), ZEND_STRL("transferInfo"), 0, &info_tmp);
/* request completed? */
if (Z_TYPE_P(info) != IS_OBJECT) {
}
if (info_len && info_name) {
- info = zend_read_property(NULL, info, php_http_pretty_key(info_name, info_len, 0, 0), info_len, 0);
+ info = zend_read_property(NULL, info, php_http_pretty_key(info_name, info_len, 0, 0), info_len, 0, &info_name_tmp);
if (!info) {
php_http_throw(unexpected_val, "Could not find transfer info with name '%s'", info_name);
zend_fcall_info_cache fcc; \
zval rv, mn, *args = ecalloc(sizeof(zval), ZEND_NUM_ARGS()); \
zval *this_ptr = getThis(); \
- zval *qs = zend_read_property(Z_OBJCE_P(this_ptr), this_ptr, ZEND_STRL(prop), 0); \
+ zval qs_tmp, *qs = zend_read_property(Z_OBJCE_P(this_ptr), this_ptr, ZEND_STRL(prop), 0, &qs_tmp); \
\
array_init(&mn); \
Z_TRY_ADDREF_P(qs); \
if (ZEND_NUM_ARGS()) {
call_querystring_get("form");
} else {
- zval *zform = zend_read_property(php_http_env_request_class_entry, getThis(), ZEND_STRL("form"), 0);
+ zval zform_tmp, *zform = zend_read_property(php_http_env_request_class_entry, getThis(), ZEND_STRL("form"), 0, &zform_tmp);
RETURN_ZVAL_FAST(zform);
}
}
if (ZEND_NUM_ARGS()) {
call_querystring_get("query");
} else {
- zval *zquery = zend_read_property(php_http_env_request_class_entry, getThis(), ZEND_STRL("query"), 0);
+ zval zquery_tmp, *zquery = zend_read_property(php_http_env_request_class_entry, getThis(), ZEND_STRL("query"), 0, &zquery_tmp);
RETURN_ZVAL_FAST(zquery);
}
}
if (ZEND_NUM_ARGS()) {
call_querystring_get("cookie");
} else {
- zval *zcookie = zend_read_property(php_http_env_request_class_entry, getThis(), ZEND_STRL("cookie"), 0);
+ zval zcookie_tmp, *zcookie = zend_read_property(php_http_env_request_class_entry, getThis(), ZEND_STRL("cookie"), 0, &zcookie_tmp);
RETURN_ZVAL_FAST(zcookie);
}
}
static PHP_METHOD(HttpEnvRequest, getFiles)
{
if (SUCCESS == zend_parse_parameters_none()) {
- zval *zfiles = zend_read_property(php_http_env_request_class_entry, getThis(), ZEND_STRL("files"), 0);
+ zval zfiles_tmp, *zfiles = zend_read_property(php_http_env_request_class_entry, getThis(), ZEND_STRL("files"), 0, &zfiles_tmp);
RETURN_ZVAL_FAST(zfiles);
}
}
}
}
}
-static zval *get_option(zval *options, const char *name_str, size_t name_len)
+static zval *get_option(zval *options, const char *name_str, size_t name_len, zval *tmp)
{
zval *val = NULL;
if (Z_TYPE_P(options) == IS_OBJECT) {
- val = zend_read_property(Z_OBJCE_P(options), options, name_str, name_len, 0);
+ val = zend_read_property(Z_OBJCE_P(options), options, name_str, name_len, 0, tmp);
} else if (Z_TYPE_P(options) == IS_ARRAY) {
val = zend_symtable_str_find(Z_ARRVAL_P(options), name_str, name_len);
} else {
}
static php_http_message_body_t *get_body(zval *options)
{
- zval *zbody;
+ zval zbody_tmp, *zbody;
php_http_message_body_t *body = NULL;
- if ((zbody = get_option(options, ZEND_STRL("body")))) {
+ if ((zbody = get_option(options, ZEND_STRL("body"), &zbody_tmp))) {
if ((Z_TYPE_P(zbody) == IS_OBJECT) && instanceof_function(Z_OBJCE_P(zbody), php_http_message_body_class_entry)) {
php_http_message_body_object_t *body_obj = PHP_HTTP_OBJ(NULL, zbody);
}
static php_http_message_t *get_request(zval *options)
{
- zval *zrequest;
+ zval zrequest_tmp, *zrequest;
php_http_message_t *request = NULL;
- if ((zrequest = get_option(options, ZEND_STRL("request")))) {
+ if ((zrequest = get_option(options, ZEND_STRL("request"), &zrequest_tmp))) {
if (Z_TYPE_P(zrequest) == IS_OBJECT && instanceof_function(Z_OBJCE_P(zrequest), php_http_message_class_entry)) {
php_http_message_object_t *request_obj = PHP_HTTP_OBJ(NULL, zrequest);
}
static void set_cookie(zval *options, zval *zcookie_new)
{
- zval tmp, *zcookies_set;
+ zval tmp, zcookies_set_tmp, *zcookies_set;
php_http_arrkey_t key;
php_http_cookie_object_t *obj = PHP_HTTP_OBJ(NULL, zcookie_new);
array_init(&tmp);
- zcookies_set = get_option(options, ZEND_STRL("cookies"));
+ zcookies_set = get_option(options, ZEND_STRL("cookies"), &zcookies_set_tmp);
if (zcookies_set && Z_TYPE_P(zcookies_set) == IS_ARRAY) {
array_copy(Z_ARRVAL_P(zcookies_set), Z_ARRVAL(tmp));
zval_ptr_dtor(zcookies_set);
php_http_cache_status_t ret = PHP_HTTP_CACHE_NO;
char *header = NULL, *etag = NULL;
php_http_message_body_t *body;
- zval *zetag;
+ zval zetag_tmp, *zetag;
if (!(body = get_body(options))) {
return ret;
}
- if ((zetag = get_option(options, ZEND_STRL("etag"))) && Z_TYPE_P(zetag) != IS_NULL) {
+ if ((zetag = get_option(options, ZEND_STRL("etag"), &zetag_tmp)) && Z_TYPE_P(zetag) != IS_NULL) {
zend_string *zs = zval_get_string(zetag);
etag = estrndup(zs->val, zs->len);
zend_string_release(zs);
char *header;
time_t ums, lm = 0;
php_http_message_body_t *body;
- zval *zlm;
+ zval zlm_tmp, *zlm;
if (!(body = get_body(options))) {
return ret;
}
- if ((zlm = get_option(options, ZEND_STRL("lastModified")))) {
+ if ((zlm = get_option(options, ZEND_STRL("lastModified"), &zlm_tmp))) {
lm = zval_get_long(zlm);
zval_ptr_dtor(zlm);
}
static ZEND_RESULT_CODE php_http_env_response_send_head(php_http_env_response_t *r, php_http_message_t *request)
{
ZEND_RESULT_CODE ret = SUCCESS;
- zval *zoption, *options = &r->options;
+ zval zoption_tmp, *zoption, *options = &r->options;
if (r->done) {
return ret;
}
- if ((zoption = get_option(options, ZEND_STRL("headers")))) {
+ if ((zoption = get_option(options, ZEND_STRL("headers"), &zoption_tmp))) {
if (Z_TYPE_P(zoption) == IS_ARRAY) {
php_http_header_to_callback(Z_ARRVAL_P(zoption), 0, (php_http_pass_format_callback_t) r->ops->set_header, r);
}
return ret;
}
- if ((zoption = get_option(options, ZEND_STRL("responseCode")))) {
+ if ((zoption = get_option(options, ZEND_STRL("responseCode"), &zoption_tmp))) {
zend_long rc = zval_get_long(zoption);
zval_ptr_dtor(zoption);
return ret;
}
- if ((zoption = get_option(options, ZEND_STRL("httpVersion")))) {
+ if ((zoption = get_option(options, ZEND_STRL("httpVersion"), &zoption_tmp))) {
php_http_version_t v;
zend_string *zs = zval_get_string(zoption);
return ret;
}
- if ((zoption = get_option(options, ZEND_STRL("cookies")))) {
+ if ((zoption = get_option(options, ZEND_STRL("cookies"), &zoption_tmp))) {
if (Z_TYPE_P(zoption) == IS_ARRAY) {
zval *zcookie;
return ret;
}
- if ((zoption = get_option(options, ZEND_STRL("contentType")))) {
+ if ((zoption = get_option(options, ZEND_STRL("contentType"), &zoption_tmp))) {
zend_string *zs = zval_get_string(zoption);
zval_ptr_dtor(zoption);
}
}
} else {
- if ((zoption = get_option(options, ZEND_STRL("cacheControl")))) {
+ if ((zoption = get_option(options, ZEND_STRL("cacheControl"), &zoption_tmp))) {
zend_string *zs = zval_get_string(zoption);
zval_ptr_dtor(zoption);
return ret;
}
- if ((zoption = get_option(options, ZEND_STRL("contentDisposition")))) {
+ if ((zoption = get_option(options, ZEND_STRL("contentDisposition"), &zoption_tmp))) {
if (Z_TYPE_P(zoption) == IS_ARRAY) {
php_http_buffer_t buf;
return ret;
}
- if ((zoption = get_option(options, ZEND_STRL("contentEncoding")))) {
+ if ((zoption = get_option(options, ZEND_STRL("contentEncoding"), &zoption_tmp))) {
zend_long ce = zval_get_long(zoption);
zval zsupported;
HashTable *result = NULL;
break;
}
- if ((zoption = get_option(options, ZEND_STRL("etag")))) {
+ if ((zoption = get_option(options, ZEND_STRL("etag"), &zoption_tmp))) {
zend_string *zs = zval_get_string(zoption);
zval_ptr_dtor(zoption);
}
zend_string_release(zs);
}
- if ((zoption = get_option(options, ZEND_STRL("lastModified") TSRMLS_CC))) {
+ if ((zoption = get_option(options, ZEND_STRL("lastModified"), &zoption_tmp))) {
zend_long lm = zval_get_long(zoption);
zval_ptr_dtor(zoption);
static ZEND_RESULT_CODE php_http_env_response_send_body(php_http_env_response_t *r)
{
ZEND_RESULT_CODE ret = SUCCESS;
- zval *zoption;
+ zval zoption_tmp, *zoption;
php_http_message_body_t *body;
if (r->done) {
}
if ((body = get_body(&r->options))) {
- if ((zoption = get_option(&r->options, ZEND_STRL("throttleDelay")))) {
+ if ((zoption = get_option(&r->options, ZEND_STRL("throttleDelay"), &zoption_tmp))) {
r->throttle.delay = zval_get_double(zoption);
zval_ptr_dtor(zoption);
}
- if ((zoption = get_option(&r->options, ZEND_STRL("throttleChunk") TSRMLS_CC))) {
+ if ((zoption = get_option(&r->options, ZEND_STRL("throttleChunk"), &zoption_tmp))) {
r->throttle.chunk = zval_get_long(zoption);
zval_ptr_dtor(zoption);
}
if (SUCCESS == zend_parse_parameters_none()) {
php_http_buffer_t buf;
zend_string *zs;
+ zval name_tmp, value_tmp;
php_http_buffer_init(&buf);
- zs = zval_get_string(zend_read_property(php_http_header_class_entry, getThis(), ZEND_STRL("name"), 0));
+ zs = zval_get_string(zend_read_property(php_http_header_class_entry, getThis(), ZEND_STRL("name"), 0, &name_tmp));
php_http_buffer_appendz(&buf, zs);
zend_string_release(zs);
- zs = zval_get_string(zend_read_property(php_http_header_class_entry, getThis(), ZEND_STRL("value"), 0));
+ zs = zval_get_string(zend_read_property(php_http_header_class_entry, getThis(), ZEND_STRL("value"), 0, &value_tmp));
if (zs->len) {
php_http_buffer_appends(&buf, ": ");
php_http_buffer_appendz(&buf, zs);
size_t val_len;
zend_long flags = PHP_HTTP_MATCH_LOOSE;
zend_string *zs;
+ zval value_tmp;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "|sl", &val_str, &val_len, &flags)) {
return;
}
- zs = zval_get_string(zend_read_property(php_http_header_class_entry, getThis(), ZEND_STRL("value"), 0));
+ zs = zval_get_string(zend_read_property(php_http_header_class_entry, getThis(), ZEND_STRL("value"), 0, &value_tmp));
RETVAL_BOOL(php_http_match(zs->val, val_str, flags));
zend_string_release(zs);
}
PHP_METHOD(HttpHeader, negotiate)
{
HashTable *supported, *rs;
- zval *rs_array = NULL;
+ zval name_tmp, value_tmp, *rs_array = NULL;
zend_string *zs;
char *sep_str = NULL;
size_t sep_len = 0;
array_init(rs_array);
}
- zs = zval_get_string(zend_read_property(php_http_header_class_entry, getThis(), ZEND_STRL("name"), 0));
+ zs = zval_get_string(zend_read_property(php_http_header_class_entry, getThis(), ZEND_STRL("name"), 0, &name_tmp));
if (zend_string_equals_literal(zs, "Accept")) {
sep_str = "/";
sep_len = 1;
}
zend_string_release(zs);
- zs = zval_get_string(zend_read_property(php_http_header_class_entry, getThis(), ZEND_STRL("value"), 0));
+ zs = zval_get_string(zend_read_property(php_http_header_class_entry, getThis(), ZEND_STRL("value"), 0, &value_tmp));
if ((rs = php_http_negotiate(zs->val, zs->len, supported, sep_str, sep_len))) {
PHP_HTTP_DO_NEGOTIATE_HANDLE_RESULT(rs, supported, rs_array);
} else {
ZEND_END_ARG_INFO();
PHP_METHOD(HttpHeader, getParams)
{
- zval zctor, zparams_obj, *zargs = NULL;
+ zval value_tmp, zctor, zparams_obj, *zargs = NULL;
ZVAL_STRINGL(&zctor, "__construct", lenof("__construct"));
object_init_ex(&zparams_obj, php_http_params_class_entry);
zargs = (zval *) ecalloc(ZEND_NUM_ARGS()+1, sizeof(zval));
- ZVAL_COPY_VALUE(&zargs[0], zend_read_property(php_http_header_class_entry, getThis(), ZEND_STRL("value"), 0));
+ ZVAL_COPY_VALUE(&zargs[0], zend_read_property(php_http_header_class_entry, getThis(), ZEND_STRL("value"), 0, &value_tmp));
if (ZEND_NUM_ARGS()) {
zend_get_parameters_array(ZEND_NUM_ARGS(), ZEND_NUM_ARGS(), &zargs[1]);
}
php_http_params_opts_t opts = {
{zs->val, zs->len},
- php_http_params_separator_init(zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("param_sep"), 0)),
- php_http_params_separator_init(zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("arg_sep"), 0)),
- php_http_params_separator_init(zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("val_sep"), 0)),
+ php_http_params_separator_init(zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("param_sep"), 0, &tmp)),
+ php_http_params_separator_init(zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("arg_sep"), 0, &tmp)),
+ php_http_params_separator_init(zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("val_sep"), 0, &tmp)),
{{0}}, flags
};
ZEND_END_ARG_INFO();
PHP_METHOD(HttpParams, toArray)
{
- zval *zparams;
+ zval zparams_tmp, *zparams;
if (SUCCESS != zend_parse_parameters_none()) {
return;
}
- zparams = zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("params"), 0);
+ zparams = zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("params"), 0, &zparams_tmp);
RETURN_ZVAL_FAST(zparams);
}
PHP_METHOD(HttpParams, toString)
{
zval *tmp, *zparams, *zpsep, *zasep, *zvsep;
+ zval zparams_tmp, flags_tmp, psep_tmp, asep_tmp, vsep_tmp;
zend_string *psep, *asep, *vsep;
long flags;
php_http_buffer_t buf;
- zparams = zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("params"), 0);
+ zparams = zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("params"), 0, &zparams_tmp);
convert_to_array_ex(zparams);
- flags = zval_get_long(zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("flags"), 0));
+ flags = zval_get_long(zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("flags"), 0, &flags_tmp));
- zpsep = zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("param_sep"), 0);
+ zpsep = zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("param_sep"), 0, &psep_tmp);
if (Z_TYPE_P(zpsep) == IS_ARRAY && (tmp = zend_hash_get_current_data(Z_ARRVAL_P(zpsep)))) {
psep = zval_get_string(tmp);
} else {
psep = zval_get_string(zpsep);
}
- zasep = zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("arg_sep"), 0);
+ zasep = zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("arg_sep"), 0, &asep_tmp);
if (Z_TYPE_P(zasep) == IS_ARRAY && (tmp = zend_hash_get_current_data(Z_ARRVAL_P(zasep)))) {
asep = zval_get_string(tmp);
} else {
asep = zval_get_string(zasep);
}
- zvsep = zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("val_sep"), 0);
+ zvsep = zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("val_sep"), 0, &vsep_tmp);
if (Z_TYPE_P(zvsep) == IS_ARRAY && (tmp = zend_hash_get_current_data(Z_ARRVAL_P(zvsep)))) {
vsep = zval_get_string(tmp);
} else {
PHP_METHOD(HttpParams, offsetExists)
{
zend_string *name;
- zval *zparam, *zparams;
+ zval zparams_tmp, *zparam, *zparams;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name)) {
return;
}
- zparams = zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("params"), 0);
+ zparams = zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("params"), 0, &zparams_tmp);
if (Z_TYPE_P(zparams) == IS_ARRAY && (zparam = zend_symtable_find(Z_ARRVAL_P(zparams), name))) {
RETVAL_BOOL(Z_TYPE_P(zparam) != IS_NULL);
PHP_METHOD(HttpParams, offsetGet)
{
zend_string *name;
- zval *zparam, *zparams;
+ zval zparams_tmp, *zparam, *zparams;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name)) {
return;
}
- zparams = zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("params"), 0);
+ zparams = zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("params"), 0, &zparams_tmp);
if (Z_TYPE_P(zparams) == IS_ARRAY && (zparam = zend_symtable_find(Z_ARRVAL_P(zparams), name))) {
RETVAL_ZVAL_FAST(zparam);
PHP_METHOD(HttpParams, offsetUnset)
{
zend_string *name;
- zval *zparams;
+ zval zparams_tmp, *zparams;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "S", &name)) {
return;
}
- zparams = zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("params"), 0);
+ zparams = zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("params"), 0, &zparams_tmp);
if (Z_TYPE_P(zparams) == IS_ARRAY) {
zend_symtable_del(Z_ARRVAL_P(zparams), name);
PHP_METHOD(HttpParams, offsetSet)
{
zend_string *name;
- zval *zparam, *zparams, *nvalue;
+ zval zparams_tmp, *zparam, *zparams, *nvalue;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "Sz", &name, &nvalue)) {
return;
}
- zparams = zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("params"), 0);
+ zparams = zend_read_property(php_http_params_class_entry, getThis(), ZEND_STRL("params"), 0, &zparams_tmp);
convert_to_array(zparams);
if (name->len) {
array_init(&qa);
if (flags & QS_MERGE) {
- zval *old = zend_read_property(php_http_querystring_class_entry, instance, ZEND_STRL("queryArray"), 0);
+ zval old_tmp, *old = zend_read_property(php_http_querystring_class_entry, instance, ZEND_STRL("queryArray"), 0, &old_tmp);
ZVAL_DEREF(old);
if (Z_TYPE_P(old) == IS_ARRAY) {
static inline void php_http_querystring_str(zval *instance, zval *return_value)
{
- zval *qa = zend_read_property(php_http_querystring_class_entry, instance, ZEND_STRL("queryArray"), 0);
+ zval qa_tmp, *qa = zend_read_property(php_http_querystring_class_entry, instance, ZEND_STRL("queryArray"), 0, &qa_tmp);
ZVAL_DEREF(qa);
if (Z_TYPE_P(qa) == IS_ARRAY) {
}
}
-static inline void php_http_querystring_get(zval *instance, int type, char *name, uint name_len, zval *defval, zend_bool del, zval *return_value TSRMLS_DC)
+static inline void php_http_querystring_get(zval *instance, int type, char *name, uint name_len, zval *defval, zend_bool del, zval *return_value)
{
- zval *arrval, *qarray = zend_read_property(php_http_querystring_class_entry, instance, ZEND_STRL("queryArray"), 0 TSRMLS_CC);
+ zval *arrval, qarray_tmp, *qarray = zend_read_property(php_http_querystring_class_entry, instance, ZEND_STRL("queryArray"), 0, &qarray_tmp);
ZVAL_DEREF(qarray);
if ((Z_TYPE_P(qarray) == IS_ARRAY) && (arrval = zend_symtable_str_find(Z_ARRVAL_P(qarray), name, name_len))) {
/* squeeze the hash out of the zval */
if (Z_TYPE_P(params) == IS_OBJECT && instanceof_function(Z_OBJCE_P(params), php_http_querystring_class_entry)) {
- zval *qa = zend_read_property(php_http_querystring_class_entry, params, ZEND_STRL("queryArray"), 0);
+ zval qa_tmp, *qa = zend_read_property(php_http_querystring_class_entry, params, ZEND_STRL("queryArray"), 0, &qa_tmp);
ZVAL_DEREF(qa);
convert_to_array(qa);
ZEND_END_ARG_INFO();
PHP_METHOD(HttpQueryString, getIterator)
{
- zval *qa;
+ zval qa_tmp, *qa;
php_http_expect(SUCCESS == zend_parse_parameters_none(), invalid_arg, return);
- qa = zend_read_property(php_http_querystring_class_entry, getThis(), ZEND_STRL("queryArray"), 0);
+ qa = zend_read_property(php_http_querystring_class_entry, getThis(), ZEND_STRL("queryArray"), 0, &qa_tmp);
object_init_ex(return_value, spl_ce_RecursiveArrayIterator);
zend_call_method_with_1_params(return_value, spl_ce_RecursiveArrayIterator, NULL, "__construct", NULL, qa);
ZEND_END_ARG_INFO();
PHP_METHOD(HttpQueryString, toArray)
{
- zval *zqa;
+ zval zqa_tmp, *zqa;
if (SUCCESS != zend_parse_parameters_none()) {
return;
}
- zqa = zend_read_property(php_http_querystring_class_entry, getThis(), ZEND_STRL("queryArray"), 0);
+ zqa = zend_read_property(php_http_querystring_class_entry, getThis(), ZEND_STRL("queryArray"), 0, &zqa_tmp);
RETURN_ZVAL_FAST(zqa);
}
ZEND_END_ARG_INFO();
PHP_METHOD(HttpQueryString, mod)
{
- zval *params, *instance = getThis();
+ zval qa_tmp, *params, *instance = getThis();
zend_error_handling zeh;
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "z", ¶ms), invalid_arg, return);
zend_replace_error_handling(EH_THROW, php_http_exception_bad_querystring_class_entry, &zeh);
ZVAL_OBJ(return_value, Z_OBJ_HT_P(instance)->clone_obj(instance));
/* make sure we do not inherit the reference to _GET */
- SEPARATE_ZVAL(zend_read_property(Z_OBJCE_P(return_value), return_value, ZEND_STRL("queryArray"), 0));
+ SEPARATE_ZVAL(zend_read_property(Z_OBJCE_P(return_value), return_value, ZEND_STRL("queryArray"), 0, &qa_tmp));
php_http_querystring_set(return_value, params, QS_MERGE);
zend_restore_error_handling(&zeh);
}
{
char *ie, *oe;
size_t ie_len, oe_len;
- zval na, *qa;
+ zval na, qa_tmp, *qa;
php_http_expect(SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS(), "ss", &ie, &ie_len, &oe, &oe_len), invalid_arg, return);
array_init(&na);
- qa = zend_read_property(php_http_querystring_class_entry, getThis(), ZEND_STRL("queryArray"), 0);
+ qa = zend_read_property(php_http_querystring_class_entry, getThis(), ZEND_STRL("queryArray"), 0, &qa_tmp);
ZVAL_DEREF(qa);
convert_to_array(qa);
PHP_METHOD(HttpQueryString, offsetGet)
{
zend_string *offset;
- zval *value, *qa;
+ zval *value, qa_tmp, *qa;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "S", &offset)) {
return;
}
- qa = zend_read_property(php_http_querystring_class_entry, getThis(), ZEND_STRL("queryArray"), 0);
+ qa = zend_read_property(php_http_querystring_class_entry, getThis(), ZEND_STRL("queryArray"), 0, &qa_tmp);
ZVAL_DEREF(qa);
if (Z_TYPE_P(qa) == IS_ARRAY) {
PHP_METHOD(HttpQueryString, offsetExists)
{
zend_string *offset;
- zval *value, *qa;
+ zval *value, qa_tmp, *qa;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS(), "S", &offset)) {
return;
}
- qa = zend_read_property(php_http_querystring_class_entry, getThis(), ZEND_STRL("queryArray"), 0);
+ qa = zend_read_property(php_http_querystring_class_entry, getThis(), ZEND_STRL("queryArray"), 0, &qa_tmp);
ZVAL_DEREF(qa);
if (Z_TYPE_P(qa) == IS_ARRAY) {
Test
%a
HTTP Support => enabled
-Extension Version => 2.%s
+Extension Version => 3.%s
%a
Done