#include "php.h"
#include "php_http.h"
+#include "php_http_std_defs.h"
#include "php_http_api.h"
+#include "php_http_cache_api.h"
#include "php_http_curl_api.h"
-#include "php_http_std_defs.h"
+#include "php_http_date_api.h"
+#include "php_http_headers_api.h"
+#include "php_http_send_api.h"
+#include "php_http_url_api.h"
+
+#include "php_http_message_object.h"
+#include "php_http_response_object.h"
+#include "php_http_request_object.h"
#ifdef ZEND_ENGINE_2
do_cache = GET_PROP(obj, cache);
do_gzip = GET_PROP(obj, gzip);
+ /* gzip */
+ if (Z_LVAL_P(do_gzip)) {
+ php_start_ob_buffer_named("ob_gzhandler", 0, 1 TSRMLS_CC);
+ }
+
/* caching */
if (Z_LVAL_P(do_cache)) {
zval *cctrl, *etag, *lmod, *ccraw;
}
}
- /* gzip */
- if (Z_LVAL_P(do_gzip)) {
- /* ... */
- }
-
/* content type */
{
zval *ctype = GET_PROP(obj, contentType);
/* }}} */
/* }}} */
+/* {{{ HttpMessage */
+
+/* {{{ void HttpMessage::__construct([string raw_message]) */
+PHP_METHOD(HttpMessage, __construct)
+{
+ zval *message = NULL;
+ int message_len;
+ getObject(http_message_object, obj);
+ http_message *msg = obj->message;
+
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z/", &message)) {
+ return;
+ }
+
+ if (message) {
+ SET_PROP(obj, raw, message);
+ }
+}
+/* }}} */
+
+/* {{{ void HttpMessage::__destruct() */
+PHP_METHOD(HttpMessage, __destruct)
+{
+ getObject(http_message_object, obj);
+
+ NO_ARGS;
+
+}
+/* }}} */
+
+/* }}} */
+
#ifdef HTTP_HAVE_CURL
/* {{{ HttpRequest */
data = GET_PROP(obj, responseData);
if ( (SUCCESS == zend_hash_find(Z_ARRVAL_P(data), "headers", sizeof("headers"), (void **) &hdrs)) &&
- (SUCCESS == zend_hash_find(Z_ARRVAL_PP(hdrs), "Status", sizeof("Status"), (void **) &code))) {
+ (SUCCESS == zend_hash_find(Z_ARRVAL_PP(hdrs), "Response Status", sizeof("Response Status"), (void **) &code))) {
RETVAL_STRINGL(Z_STRVAL_PP(code), Z_STRLEN_PP(code), 1);
convert_to_long(return_value);
} else {