+/* {{{ proto string HttpMessage::getInfo(void)
+ Get the HTTP request/response line */
+PHP_METHOD(HttpMessage, getInfo)
+{
+ NO_ARGS;
+
+ if (return_value_used) {
+ getObject(http_message_object, obj);
+
+ switch (obj->message->type) {
+ case HTTP_MSG_REQUEST:
+ Z_STRLEN_P(return_value) = spprintf(&Z_STRVAL_P(return_value), 0, HTTP_INFO_REQUEST_FMT_ARGS(&obj->message->http, ""));
+ break;
+ case HTTP_MSG_RESPONSE:
+ Z_STRLEN_P(return_value) = spprintf(&Z_STRVAL_P(return_value), 0, HTTP_INFO_RESPONSE_FMT_ARGS(&obj->message->http, ""));
+ break;
+ default:
+ RETURN_NULL();
+ break;
+ }
+ Z_TYPE_P(return_value) = IS_STRING;
+ }
+}
+/* }}} */
+
+/* {{{ proto bool HttpMessage::setInfo(string http_info)
+ Set type and request or response info with a standard HTTP request or response line */
+PHP_METHOD(HttpMessage, setInfo)
+{
+ char *str;
+ int len;
+ http_info inf;
+
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &str, &len) && SUCCESS == http_info_parse_ex(str, &inf, 0)) {
+ getObject(http_message_object, obj);
+
+ http_message_set_info(obj->message, &inf);
+ http_info_dtor(&inf);
+ RETURN_TRUE;
+ }
+ RETURN_FALSE;
+}
+/* }}} */
+