}
/* }}} */
+/* {{{ proto bool HttpRequest::setPostFiles()
+ *
+ * Set files to post.
+ * Overwrites previously set post files.
+ * Affects only POST requests.
+ */
+PHP_METHOD(HttpRequest, setPostFiles)
+{
+ zval *files, *pFiles;
+ getObject(http_request_object, obj);
+
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &files)) {
+ RETURN_FALSE;
+ }
+
+ pFiles = GET_PROP(obj, postFiles);
+ zend_hash_clean(Z_ARRVAL_P(pFiles));
+ array_copy(files, pFiles);
+
+ RETURN_TRUE;
+}
+/* }}} */
+
/* {{{ proto array HttpRequest::getPostFiles()
*
* Get all previously added POST files.
}
/* }}} */
+/* {{{ proto bool HttpRequest::SetPutFile(string file)
+ *
+ * Set file to put.
+ * Affects only PUT requests.
+ */
+PHP_METHOD(HttpRequest, setPutFile)
+{
+ char *file;
+ int file_len;
+ getObject(http_request_object, obj);
+
+ if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &file, &file_len)) {
+ RETURN_FALSE;
+ }
+
+ UPD_PROP(obj, string, putFile, file);
+ RETURN_TRUE;
+}
+/* }}} */
+
+/* {{{ proto string HttpRequest::getPutFile()
+ *
+ * Get previously set put file.
+ */
+PHP_METHOD(HttpRequest, getPutFile)
+{
+ NO_ARGS;
+
+ IF_RETVAL_USED {
+ zval *putfile;
+ getObject(http_request_object, obj);
+
+ putfile = GET_PROP(obj, putFile);
+ RETVAL_STRINGL(Z_STRVAL_P(putfile), Z_STRLEN_P(putfile), 1);
+ }
+}
+/* }}} */
+
+/* {{{ proto void HttpRequest::unsetPutFile()
+ *
+ * Unset file to put.
+ * Affects only PUT requests.
+ */
+PHP_METHOD(HttpRequest, unsetPutFile)
+{
+ getObject(http_request_object, obj);
+
+ NO_ARGS;
+
+ UPD_PROP(obj, string, putFile, "");
+}
+/* }}} */
+
/* {{{ proto array HttpRequest::getResponseData()
*
* Get all response data after the request has been sent.
PHP_ME(HttpRequest, addPostFields, NULL, ZEND_ACC_PUBLIC)
PHP_ME(HttpRequest, unsetPostFields, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(HttpRequest, setPostFiles, NULL, ZEND_ACC_PUBLIC)
PHP_ME(HttpRequest, addPostFile, NULL, ZEND_ACC_PUBLIC)
PHP_ME(HttpRequest, getPostFiles, NULL, ZEND_ACC_PUBLIC)
PHP_ME(HttpRequest, unsetPostFiles, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(HttpRequest, setPutFile, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(HttpRequest, getPutFile, NULL, ZEND_ACC_PUBLIC)
+ PHP_ME(HttpRequest, unsetPutFile, NULL, ZEND_ACC_PUBLIC)
+
PHP_ME(HttpRequest, send, NULL, ZEND_ACC_PUBLIC)
PHP_ME(HttpRequest, getResponseData, NULL, ZEND_ACC_PUBLIC)
DCL_PROP(PROTECTED, string, url, "");
DCL_PROP(PROTECTED, string, contentType, "");
DCL_PROP(PROTECTED, string, queryData, "");
- DCL_PROP(PROTECTED, string, postFields, "");
+ DCL_PROP(PROTECTED, string, putFile, "");
}
void _http_request_object_free(zend_object *object TSRMLS_DC)
PHP_METHOD(HttpRequest, addPostFields);
PHP_METHOD(HttpRequest, unsetPostFields);
PHP_METHOD(HttpRequest, addPostFile);
+PHP_METHOD(HttpRequest, setPostFiles);
PHP_METHOD(HttpRequest, getPostFiles);
PHP_METHOD(HttpRequest, unsetPostFiles);
+PHP_METHOD(HttpRequest, setPutFile);
+PHP_METHOD(HttpRequest, getPutFile);
+PHP_METHOD(HttpRequest, unsetPutFile);
PHP_METHOD(HttpRequest, send);
PHP_METHOD(HttpRequest, getResponseData);
PHP_METHOD(HttpRequest, getResponseHeader);