projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
- rename http_absolute_uri to http_build_uri (complements http_build_query)
[m6w6/ext-http]
/
http_request_object.c
diff --git
a/http_request_object.c
b/http_request_object.c
index 0a6c5d1a4ea47df32b7f84a8708e2199ab6bcaae..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);
@@
-344,6
+345,7
@@
static inline void _http_request_object_declare_default_properties(TSRMLS_D)
DCL_PROP(PUBLIC, bool, recordHistory, 1);
DCL_PROP(PUBLIC, bool, recordHistory, 1);
+#ifndef WONKY
/*
* Request Method Constants
*/
/*
* Request Method Constants
*/
@@
-388,6
+390,7
@@
static inline void _http_request_object_declare_default_properties(TSRMLS_D)
DCL_CONST(long, "AUTH_NTLM", CURLAUTH_NTLM);
DCL_CONST(long, "AUTH_ANY", CURLAUTH_ANY);
# endif /* LIBCURL_VERSION_NUM */
DCL_CONST(long, "AUTH_NTLM", CURLAUTH_NTLM);
DCL_CONST(long, "AUTH_ANY", CURLAUTH_ANY);
# endif /* LIBCURL_VERSION_NUM */
+#endif /* WONKY */
}
void _http_request_object_free(zend_object *object TSRMLS_DC)
}
void _http_request_object_free(zend_object *object TSRMLS_DC)
@@
-1594,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;
@@
-1609,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()
*