+#! /usr/bin/php
<?php
function hl($m)
#ifndef HTTP_HAVE_SAPI_RTIME
G->request_time = time(NULL);
#endif
+ G->read_post_data = 0;
}
#define http_globals_free(g) _http_globals_free((g) TSRMLS_CC)
#define http_querystring_modify(q, p) _http_querystring_modify((q), (p) TSRMLS_CC)
static inline int _http_querystring_modify(zval *qarray, zval *params TSRMLS_DC)
{
- if (Z_TYPE_P(params) == IS_ARRAY) {
+ if ((Z_TYPE_P(params) == IS_OBJECT) && instanceof_function(Z_OBJCE_P(params), http_querystring_object_ce TSRMLS_CC)) {
+ return http_querystring_modify_array(qarray, GET_PROP_EX(params, queryArray));
+ } else if (Z_TYPE_P(params) == IS_ARRAY) {
return http_querystring_modify_array(qarray, params);
} else {
int rv;
{
char *ctype;
int ct_len;
- getObject(http_request_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &ctype, &ct_len)) {
RETURN_FALSE;
PHP_METHOD(HttpRequest, setQueryData)
{
zval *qdata = NULL;
- getObject(http_request_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z!", &qdata)) {
RETURN_FALSE;
memmove(&ptr[1], pos, end - pos);
}
break;
+
+ default:
+ /* something else */
+ ++ptr;
+ break;
}
}
}
var_dump(HttpQueryString::getInstance()->get('r', HttpQueryString::TYPE_ARRAY));
var_dump(HttpQueryString::getInstance()->get('r', HttpQueryString::TYPE_OBJECT));
-HttpQueryString::getInstance()->set('z[0]=2');
+HttpQueryString::getInstance()->set(new HttpQueryString(false, 'z[0]=2'));
HttpQueryString::getInstance()->set(array('a'=>'b', 'c'=> "3.4"));
HttpQueryString::getInstance()->set(array('a' => NULL));