- ditch HttpMessage::__construct() and ::setRaw
[m6w6/ext-http] / http_methods.c
index dfbc712dd80d17e9a95c7618e3f7ce1d04b88ee4..e4023bc5a7c46d4b0b030af431997bf594cde198 100644 (file)
@@ -532,6 +532,7 @@ PHP_METHOD(HttpMessage, fromString)
        char *string = NULL;
        int length = 0;
        http_message *msg = NULL;
        char *string = NULL;
        int length = 0;
        http_message *msg = NULL;
+       http_message_object obj;
 
        if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &string, &length)) {
                RETURN_NULL();
 
        if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &string, &length)) {
                RETURN_NULL();
@@ -546,45 +547,6 @@ PHP_METHOD(HttpMessage, fromString)
 }
 /* }}} */
 
 }
 /* }}} */
 
-/* {{{ proto void HttpMessage::__construct([string raw_message])
- *
- * Instantiate a new HttpMessage object based on the optionally provided
- * raw message.  An HTTP Message can be either a response or a request.
- */
-PHP_METHOD(HttpMessage, __construct)
-{
-       zval *message = NULL;
-       getObject(http_message_object, obj);
-
-       SET_EH_THROW_HTTP();
-       if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|z/", &message)) {
-               if (message) {
-                       convert_to_string(message);
-                       SET_PROP(obj, raw, message);
-               }
-       }
-       SET_EH_NORMAL();
-}
-/* }}} */
-
-/* {{{ proto void HttpMessage::setRaw(string raw_message)
- *
- * Parse a new raw message.
- */
-PHP_METHOD(HttpMessage, setRaw)
-{
-       zval *message;
-       getObject(http_message_object, obj);
-
-       if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z/", &message)) {
-               return;
-       }
-
-       convert_to_string(message);
-       SET_PROP(obj, raw, message);
-}
-/* }}} */
-
 /* {{{ proto string HttpMessage::getBody()
  *
  * Get the body of the parsed Message.
 /* {{{ proto string HttpMessage::getBody()
  *
  * Get the body of the parsed Message.
@@ -890,29 +852,6 @@ PHP_METHOD(HttpMessage, setHttpVersion)
 }
 /* }}} */
 
 }
 /* }}} */
 
-/* {{{ proto HttpMessage HttpMessage::getNestedMessage()
- *
- * Get nested HTTP Message.
- */
-PHP_METHOD(HttpMessage, getNestedMessage)
-{
-       zval *nested;
-       getObject(http_message_object, obj);
-       
-       NO_ARGS;
-       
-       nested = GET_PROP(obj, nestedMessage);
-       if (Z_TYPE_P(nested) == IS_OBJECT) {
-               Z_TYPE_P(return_value) = IS_OBJECT;
-               return_value->is_ref = 1;
-               return_value->value.obj = nested->value.obj;
-               zval_add_ref(&return_value);
-       } else {
-               RETVAL_NULL();
-       }
-}
-/* }}} */
-
 /* {{{ proto string HttpMessage::toString()
  *
  * Get the string representation of the Message.
 /* {{{ proto string HttpMessage::toString()
  *
  * Get the string representation of the Message.