projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
- added HttpRequest::clearHistory()
[m6w6/ext-http]
/
http_request_object.c
diff --git
a/http_request_object.c
b/http_request_object.c
index f1f2551d0328e4094651256ee1ce3b79b60a587f..0a56e586679ef18332714f2b787dc5d5e7c08628 100644
(file)
--- a/
http_request_object.c
+++ b/
http_request_object.c
@@
-158,6
+158,7
@@
HTTP_END_ARGS;
HTTP_EMPTY_ARGS(getResponseMessage, 1);
HTTP_EMPTY_ARGS(getRequestMessage, 1);
HTTP_EMPTY_ARGS(getHistory, 1);
HTTP_EMPTY_ARGS(getResponseMessage, 1);
HTTP_EMPTY_ARGS(getRequestMessage, 1);
HTTP_EMPTY_ARGS(getHistory, 1);
+HTTP_EMPTY_ARGS(clearHistory, 0);
HTTP_EMPTY_ARGS(send, 1);
HTTP_BEGIN_ARGS(get, 0, 1)
HTTP_EMPTY_ARGS(send, 1);
HTTP_BEGIN_ARGS(get, 0, 1)
@@
-276,6
+277,7
@@
zend_function_entry http_request_object_fe[] = {
HTTP_REQUEST_ME(getResponseMessage, ZEND_ACC_PUBLIC)
HTTP_REQUEST_ME(getRequestMessage, ZEND_ACC_PUBLIC)
HTTP_REQUEST_ME(getHistory, ZEND_ACC_PUBLIC)
HTTP_REQUEST_ME(getResponseMessage, ZEND_ACC_PUBLIC)
HTTP_REQUEST_ME(getRequestMessage, ZEND_ACC_PUBLIC)
HTTP_REQUEST_ME(getHistory, ZEND_ACC_PUBLIC)
+ HTTP_REQUEST_ME(clearHistory, ZEND_ACC_PUBLIC)
HTTP_REQUEST_ALIAS(get, http_get)
HTTP_REQUEST_ALIAS(head, http_head)
HTTP_REQUEST_ALIAS(get, http_get)
HTTP_REQUEST_ALIAS(head, http_head)
@@
-306,7
+308,6
@@
zend_object_value _http_request_object_new(zend_class_entry *ce TSRMLS_DC)
o = ecalloc(1, sizeof(http_request_object));
o->zo.ce = ce;
o->ch = curl_easy_init();
o = ecalloc(1, sizeof(http_request_object));
o->zo.ce = ce;
o->ch = curl_easy_init();
- o->pool = NULL;
phpstr_init(&o->history);
phpstr_init(&o->request);
phpstr_init(&o->history);
phpstr_init(&o->request);
@@
-1596,6
+1597,10
@@
PHP_METHOD(HttpRequest, getRequestMessage)
}
/* }}} */
}
/* }}} */
+/* {{{ proto HttpMessage HttpRequest::getHistory()
+ *
+ * Get all sent requests and received responses as an HttpMessage object.
+ */
PHP_METHOD(HttpRequest, getHistory)
{
NO_ARGS;
PHP_METHOD(HttpRequest, getHistory)
{
NO_ARGS;
@@
-1611,6
+1616,20
@@
PHP_METHOD(HttpRequest, getHistory)
SET_EH_NORMAL();
}
}
SET_EH_NORMAL();
}
}
+/* }}} */
+
+/* {{{ proto void HttpRequest::clearHistory()
+ *
+ * Clear the history.
+ */
+PHP_METHOD(HttpRequest, clearHistory)
+{
+ NO_ARGS {
+ getObject(http_request_object, obj);
+ phpstr_dtor(&obj->history);
+ }
+}
+/* }}} */
/* {{{ proto HttpMessage HttpRequest::send()
*
/* {{{ proto HttpMessage HttpRequest::send()
*