projects
/
m6w6
/
ext-http
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
|
inline
| side by side (parent:
42d4e27
)
* renamed classes
author
Michael Wallner
<mike@php.net>
Sun, 20 Mar 2005 17:35:40 +0000
(17:35 +0000)
committer
Michael Wallner
<mike@php.net>
Sun, 20 Mar 2005 17:35:40 +0000
(17:35 +0000)
http_methods.c
patch
|
blob
|
history
diff --git
a/http_methods.c
b/http_methods.c
index 0f80c6ce21e3441e3772523953ebf1de35ac689b..ded27ff88ee5313b10fcb2b020ee1f320ee5cb9f 100644
(file)
--- a/
http_methods.c
+++ b/
http_methods.c
@@
-25,24
+25,22
@@
#include "php_http_curl_api.h"
#include "php_http_std_defs.h"
#include "php_http_curl_api.h"
#include "php_http_std_defs.h"
-#include "ext/standard/php_smart_str.h"
-
#ifdef ZEND_ENGINE_2
#ifdef ZEND_ENGINE_2
-/* {{{ H
TTPi_
Response */
+/* {{{ H
ttp
Response */
-/* {{{ proto void H
TTPi_
Response::__construct(bool cache, bool gzip)
+/* {{{ proto void H
ttp
Response::__construct(bool cache, bool gzip)
*
*
- * Instantiates a new H
TTPi_
Response object, which can be used to send
+ * Instantiates a new H
ttp
Response object, which can be used to send
* any data/resource/file to an HTTP client with caching and multiple
* ranges/resuming support.
*
* NOTE: GZIPping is not implemented yet.
*/
* any data/resource/file to an HTTP client with caching and multiple
* ranges/resuming support.
*
* NOTE: GZIPping is not implemented yet.
*/
-PHP_METHOD(H
TTPi_
Response, __construct)
+PHP_METHOD(H
ttp
Response, __construct)
{
zend_bool do_cache = 0, do_gzip = 0;
{
zend_bool do_cache = 0, do_gzip = 0;
- getObject(http
i
_response_object, obj);
+ getObject(http_response_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bb", &do_cache, &do_gzip)) {
// throw exception
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bb", &do_cache, &do_gzip)) {
// throw exception
@@
-54,7
+52,7
@@
PHP_METHOD(HTTPi_Response, __construct)
}
/* }}} */
}
/* }}} */
-/* {{{ proto bool H
TTPi_
Response::setCache(bool cache)
+/* {{{ proto bool H
ttp
Response::setCache(bool cache)
*
* Whether it sould be attempted to cache the entitity.
* This will result in necessary caching headers and checks of clients
*
* Whether it sould be attempted to cache the entitity.
* This will result in necessary caching headers and checks of clients
@@
-64,10
+62,10
@@
PHP_METHOD(HTTPi_Response, __construct)
* NOTE: If you're using sessions, be shure that you set session.cache_limiter
* to something more appropriate than "no-cache"!
*/
* NOTE: If you're using sessions, be shure that you set session.cache_limiter
* to something more appropriate than "no-cache"!
*/
-PHP_METHOD(H
TTPi_
Response, setCache)
+PHP_METHOD(H
ttp
Response, setCache)
{
zend_bool do_cache = 0;
{
zend_bool do_cache = 0;
- getObject(http
i
_response_object, obj);
+ getObject(http_response_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &do_cache)) {
RETURN_FALSE;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &do_cache)) {
RETURN_FALSE;
@@
-78,14
+76,14
@@
PHP_METHOD(HTTPi_Response, setCache)
}
/* }}} */
}
/* }}} */
-/* {{{ proto bool H
TTPi_
Response::getCache()
+/* {{{ proto bool H
ttp
Response::getCache()
*
* Get current caching setting.
*/
*
* Get current caching setting.
*/
-PHP_METHOD(H
TTPi_
Response, getCache)
+PHP_METHOD(H
ttp
Response, getCache)
{
zval *do_cache = NULL;
{
zval *do_cache = NULL;
- getObject(http
i
_response_object, obj);
+ getObject(http_response_object, obj);
NO_ARGS;
NO_ARGS;
@@
-94,14
+92,14
@@
PHP_METHOD(HTTPi_Response, getCache)
}
/* }}}*/
}
/* }}}*/
-/* {{{ proto bool H
TTPi_
Response::setGzip(bool gzip)
+/* {{{ proto bool H
ttp
Response::setGzip(bool gzip)
*
* Enable on-thy-fly gzipping of the sent entity. NOT IMPLEMENTED YET.
*/
*
* Enable on-thy-fly gzipping of the sent entity. NOT IMPLEMENTED YET.
*/
-PHP_METHOD(H
TTPi_
Response, setGzip)
+PHP_METHOD(H
ttp
Response, setGzip)
{
zend_bool do_gzip = 0;
{
zend_bool do_gzip = 0;
- getObject(http
i
_response_object, obj);
+ getObject(http_response_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &do_gzip)) {
RETURN_FALSE;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "b", &do_gzip)) {
RETURN_FALSE;
@@
-112,14
+110,14
@@
PHP_METHOD(HTTPi_Response, setGzip)
}
/* }}} */
}
/* }}} */
-/* {{{ proto bool H
TTPi_
Response::getGzip()
+/* {{{ proto bool H
ttp
Response::getGzip()
*
* Get current gzipping setting.
*/
*
* Get current gzipping setting.
*/
-PHP_METHOD(H
TTPi_
Response, getGzip)
+PHP_METHOD(H
ttp
Response, getGzip)
{
zval *do_gzip = NULL;
{
zval *do_gzip = NULL;
- getObject(http
i
_response_object, obj);
+ getObject(http_response_object, obj);
NO_ARGS;
NO_ARGS;
@@
-128,17
+126,17
@@
PHP_METHOD(HTTPi_Response, getGzip)
}
/* }}} */
}
/* }}} */
-/* {{{ proto bool H
TTPi_
Response::setCacheControl(string control[, bool raw = false])
+/* {{{ proto bool H
ttp
Response::setCacheControl(string control[, bool raw = false])
*
* Set a custom cache-control header, usually being "private" or "public"; if
* $raw is set to true the header will be sent as-is.
*/
*
* Set a custom cache-control header, usually being "private" or "public"; if
* $raw is set to true the header will be sent as-is.
*/
-PHP_METHOD(H
TTPi_
Response, setCacheControl)
+PHP_METHOD(H
ttp
Response, setCacheControl)
{
char *ccontrol;
int cc_len;
zend_bool raw = 0;
{
char *ccontrol;
int cc_len;
zend_bool raw = 0;
- getObject(http
i
_response_object, obj);
+ getObject(http_response_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &ccontrol, &cc_len, &raw)) {
RETURN_FALSE;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &ccontrol, &cc_len, &raw)) {
RETURN_FALSE;
@@
-155,14
+153,14
@@
PHP_METHOD(HTTPi_Response, setCacheControl)
}
/* }}} */
}
/* }}} */
-/* {{{ proto string H
TTPi_
Response::getCacheControl()
+/* {{{ proto string H
ttp
Response::getCacheControl()
*
* Get current Cache-Control header setting.
*/
*
* Get current Cache-Control header setting.
*/
-PHP_METHOD(H
TTPi_
Response, getCacheControl)
+PHP_METHOD(H
ttp
Response, getCacheControl)
{
zval *ccontrol;
{
zval *ccontrol;
- getObject(http
i
_response_object, obj);
+ getObject(http_response_object, obj);
NO_ARGS;
NO_ARGS;
@@
-171,15
+169,15
@@
PHP_METHOD(HTTPi_Response, getCacheControl)
}
/* }}} */
}
/* }}} */
-/* {{{ proto bool H
TTPi_
Response::setContentType(string content_type)
+/* {{{ proto bool H
ttp
Response::setContentType(string content_type)
*
* Set the content-type of the sent entity.
*/
*
* Set the content-type of the sent entity.
*/
-PHP_METHOD(H
TTPi_
Response, setContentType)
+PHP_METHOD(H
ttp
Response, setContentType)
{
char *ctype;
int ctype_len;
{
char *ctype;
int ctype_len;
- getObject(http
i
_response_object, obj);
+ getObject(http_response_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &ctype, &ctype_len)) {
RETURN_FALSE;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &ctype, &ctype_len)) {
RETURN_FALSE;
@@
-197,14
+195,14
@@
PHP_METHOD(HTTPi_Response, setContentType)
}
/* }}} */
}
/* }}} */
-/* {{{ proto string H
TTPi_
Response::getContentType()
+/* {{{ proto string H
ttp
Response::getContentType()
*
* Get current Content-Type header setting.
*/
*
* Get current Content-Type header setting.
*/
-PHP_METHOD(H
TTPi_
Response, getContentType)
+PHP_METHOD(H
ttp
Response, getContentType)
{
zval *ctype;
{
zval *ctype;
- getObject(http
i
_response_object, obj);
+ getObject(http_response_object, obj);
NO_ARGS;
NO_ARGS;
@@
-213,18
+211,18
@@
PHP_METHOD(HTTPi_Response, getContentType)
}
/* }}} */
}
/* }}} */
-/* {{{ proto bool H
TTPi_
Response::setContentDisposition(string filename[, bool inline = false])
+/* {{{ proto bool H
ttp
Response::setContentDisposition(string filename[, bool inline = false])
*
* Set the Content-Disposition of the sent entity. This setting aims to suggest
* the receiveing user agent how to handle the sent entity; usually the client
* will show the user a "Save As..." popup.
*/
*
* Set the Content-Disposition of the sent entity. This setting aims to suggest
* the receiveing user agent how to handle the sent entity; usually the client
* will show the user a "Save As..." popup.
*/
-PHP_METHOD(H
TTPi_
Response, setContentDisposition)
+PHP_METHOD(H
ttp
Response, setContentDisposition)
{
char *file;
int file_len;
zend_bool is_inline = 0;
{
char *file;
int file_len;
zend_bool is_inline = 0;
- getObject(http
i
_response_object, obj);
+ getObject(http_response_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &file, &file_len, &is_inline)) {
RETURN_FALSE;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|b", &file, &file_len, &is_inline)) {
RETURN_FALSE;
@@
-236,7
+234,7
@@
PHP_METHOD(HTTPi_Response, setContentDisposition)
}
/* }}} */
}
/* }}} */
-/* {{{ proto array H
TTPi_
Response::getContentDisposition()
+/* {{{ proto array H
ttp
Response::getContentDisposition()
*
* Get current Content-Disposition setting.
* Will return an associative array like:
*
* Get current Content-Disposition setting.
* Will return an associative array like:
@@
-247,11
+245,11
@@
PHP_METHOD(HTTPi_Response, setContentDisposition)
* )
* </pre>
*/
* )
* </pre>
*/
-PHP_METHOD(H
TTPi_
Response, getContentDisposition)
+PHP_METHOD(H
ttp
Response, getContentDisposition)
{
zval *file;
zval *is_inline;
{
zval *file;
zval *is_inline;
- getObject(http
i
_response_object, obj);
+ getObject(http_response_object, obj);
if (ZEND_NUM_ARGS()) {
WRONG_PARAM_COUNT;
if (ZEND_NUM_ARGS()) {
WRONG_PARAM_COUNT;
@@
-266,15
+264,15
@@
PHP_METHOD(HTTPi_Response, getContentDisposition)
}
/* }}} */
}
/* }}} */
-/* {{{ proto bool H
TTPi_
Response::setETag(string etag)
+/* {{{ proto bool H
ttp
Response::setETag(string etag)
*
* Set a custom ETag. Use this only if you know what you're doing.
*/
*
* Set a custom ETag. Use this only if you know what you're doing.
*/
-PHP_METHOD(H
TTPi_
Response, setETag)
+PHP_METHOD(H
ttp
Response, setETag)
{
char *etag;
int etag_len;
{
char *etag;
int etag_len;
- getObject(http
i
_response_object, obj);
+ getObject(http_response_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &etag, &etag_len)) {
RETURN_FALSE;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &etag, &etag_len)) {
RETURN_FALSE;
@@
-285,14
+283,14
@@
PHP_METHOD(HTTPi_Response, setETag)
}
/* }}} */
}
/* }}} */
-/* {{{ proto string H
TTPi_
Response::getETag()
+/* {{{ proto string H
ttp
Response::getETag()
*
* Get the previously set custom ETag.
*/
*
* Get the previously set custom ETag.
*/
-PHP_METHOD(H
TTPi_
Response, getETag)
+PHP_METHOD(H
ttp
Response, getETag)
{
zval *etag;
{
zval *etag;
- getObject(http
i
_response_object, obj);
+ getObject(http_response_object, obj);
NO_ARGS;
NO_ARGS;
@@
-301,14
+299,14
@@
PHP_METHOD(HTTPi_Response, getETag)
}
/* }}} */
}
/* }}} */
-/* {{{ proto bool H
TTPi_
Response::setData(string data)
+/* {{{ proto bool H
ttp
Response::setData(string data)
*
* Set the data to be sent.
*/
*
* Set the data to be sent.
*/
-PHP_METHOD(H
TTPi_
Response, setData)
+PHP_METHOD(H
ttp
Response, setData)
{
zval *the_data;
{
zval *the_data;
- getObject(http
i
_response_object, obj);
+ getObject(http_response_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &the_data)) {
RETURN_FALSE;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &the_data)) {
RETURN_FALSE;
@@
-322,14
+320,14
@@
PHP_METHOD(HTTPi_Response, setData)
}
/* }}} */
}
/* }}} */
-/* {{{ proto string H
TTPi_
Response::getData()
+/* {{{ proto string H
ttp
Response::getData()
*
* Get the previously set data to be sent.
*/
*
* Get the previously set data to be sent.
*/
-PHP_METHOD(H
TTPi_
Response, getData)
+PHP_METHOD(H
ttp
Response, getData)
{
zval *the_data;
{
zval *the_data;
- getObject(http
i
_response_object, obj);
+ getObject(http_response_object, obj);
NO_ARGS;
NO_ARGS;
@@
-338,15
+336,15
@@
PHP_METHOD(HTTPi_Response, getData)
}
/* }}} */
}
/* }}} */
-/* {{{ proto bool H
TTPi_
Response::setStream(resource stream)
+/* {{{ proto bool H
ttp
Response::setStream(resource stream)
*
* Set the resource to be sent.
*/
*
* Set the resource to be sent.
*/
-PHP_METHOD(H
TTPi_
Response, setStream)
+PHP_METHOD(H
ttp
Response, setStream)
{
zval *the_stream;
php_stream *the_real_stream;
{
zval *the_stream;
php_stream *the_real_stream;
- getObject(http
i
_response_object, obj);
+ getObject(http_response_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &the_stream)) {
RETURN_FALSE;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &the_stream)) {
RETURN_FALSE;
@@
-361,14
+359,14
@@
PHP_METHOD(HTTPi_Response, setStream)
}
/* }}} */
}
/* }}} */
-/* {{{ proto resource H
TTPi_
Response::getStream()
+/* {{{ proto resource H
ttp
Response::getStream()
*
* Get the previously set resource to be sent.
*/
*
* Get the previously set resource to be sent.
*/
-PHP_METHOD(H
TTPi_
Response, getStream)
+PHP_METHOD(H
ttp
Response, getStream)
{
zval *the_stream;
{
zval *the_stream;
- getObject(http
i
_response_object, obj);
+ getObject(http_response_object, obj);
NO_ARGS;
NO_ARGS;
@@
-377,14
+375,14
@@
PHP_METHOD(HTTPi_Response, getStream)
}
/* }}} */
}
/* }}} */
-/* {{{ proto bool H
TTPi_
Response::setFile(string file)
+/* {{{ proto bool H
ttp
Response::setFile(string file)
*
* Set the file to be sent.
*/
*
* Set the file to be sent.
*/
-PHP_METHOD(H
TTPi_
Response, setFile)
+PHP_METHOD(H
ttp
Response, setFile)
{
zval *the_file;
{
zval *the_file;
- getObject(http
i
_response_object, obj);
+ getObject(http_response_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &the_file)) {
RETURN_FALSE;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &the_file)) {
RETURN_FALSE;
@@
-399,14
+397,14
@@
PHP_METHOD(HTTPi_Response, setFile)
}
/* }}} */
}
/* }}} */
-/* {{{ proto string H
TTPi_
Response::getFile()
+/* {{{ proto string H
ttp
Response::getFile()
*
* Get the previously set file to be sent.
*/
*
* Get the previously set file to be sent.
*/
-PHP_METHOD(H
TTPi_
Response, getFile)
+PHP_METHOD(H
ttp
Response, getFile)
{
zval *the_file;
{
zval *the_file;
- getObject(http
i
_response_object, obj);
+ getObject(http_response_object, obj);
NO_ARGS;
NO_ARGS;
@@
-415,14
+413,14
@@
PHP_METHOD(HTTPi_Response, getFile)
}
/* }}} */
}
/* }}} */
-/* {{{ proto bool H
TTPi_
Response::send()
+/* {{{ proto bool H
ttp
Response::send()
*
* Finally send the entity.
*
* Example:
* <pre>
* <?php
*
* Finally send the entity.
*
* Example:
* <pre>
* <?php
- * $r = new H
TTPi_
Response(true);
+ * $r = new H
ttp
Response(true);
* $r->setFile('../hidden/contract.pdf');
* $r->setContentType('application/pdf');
* $r->send();
* $r->setFile('../hidden/contract.pdf');
* $r->setContentType('application/pdf');
* $r->send();
@@
-430,10
+428,10
@@
PHP_METHOD(HTTPi_Response, getFile)
* </pre>
*
*/
* </pre>
*
*/
-PHP_METHOD(H
TTPi_
Response, send)
+PHP_METHOD(H
ttp
Response, send)
{
zval *do_cache, *do_gzip;
{
zval *do_cache, *do_gzip;
- getObject(http
i
_response_object, obj);
+ getObject(http_response_object, obj);
NO_ARGS;
NO_ARGS;
@@
-515,19
+513,19
@@
PHP_METHOD(HTTPi_Response, send)
/* }}} */
#ifdef HTTP_HAVE_CURL
/* }}} */
#ifdef HTTP_HAVE_CURL
-/* {{{ H
TTPi_
Request */
+/* {{{ H
ttp
Request */
-/* {{{ proto void H
TTPi_
Request::__construct([string url[, long request_method = HTTP_GET]])
+/* {{{ proto void H
ttp
Request::__construct([string url[, long request_method = HTTP_GET]])
*
*
- * Instantiate a new H
TTPi_
Request object which can be used to issue HEAD, GET
+ * Instantiate a new H
ttp
Request object which can be used to issue HEAD, GET
* and POST (including posting files) HTTP requests.
*/
* and POST (including posting files) HTTP requests.
*/
-PHP_METHOD(H
TTPi_
Request, __construct)
+PHP_METHOD(H
ttp
Request, __construct)
{
char *URL = NULL;
int URL_len;
long meth = -1;
{
char *URL = NULL;
int URL_len;
long meth = -1;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sl", &URL, &URL_len, &meth)) {
return;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|sl", &URL, &URL_len, &meth)) {
return;
@@
-548,13
+546,13
@@
PHP_METHOD(HTTPi_Request, __construct)
}
/* }}} */
}
/* }}} */
-/* {{{ proto void H
TTPi_
Request::__destruct()
+/* {{{ proto void H
ttp
Request::__destruct()
*
*
- * Destroys the H
TTPi_
Request object.
+ * Destroys the H
ttp
Request object.
*/
*/
-PHP_METHOD(H
TTPi_
Request, __destruct)
+PHP_METHOD(H
ttp
Request, __destruct)
{
{
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
NO_ARGS;
NO_ARGS;
@@
-566,16
+564,16
@@
PHP_METHOD(HTTPi_Request, __destruct)
}
/* }}} */
}
/* }}} */
-/* {{{ proto bool H
TTPi_
Request::setOptions(array options)
+/* {{{ proto bool H
ttp
Request::setOptions(array options)
*
* Set the request options to use. See http_get() for a full list of available options.
*/
*
* Set the request options to use. See http_get() for a full list of available options.
*/
-PHP_METHOD(H
TTPi_
Request, setOptions)
+PHP_METHOD(H
ttp
Request, setOptions)
{
char *key = NULL;
long idx = 0;
zval *opts, *old_opts, **opt;
{
char *key = NULL;
long idx = 0;
zval *opts, *old_opts, **opt;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &opts)) {
RETURN_FALSE;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &opts)) {
RETURN_FALSE;
@@
-611,14
+609,14
@@
PHP_METHOD(HTTPi_Request, setOptions)
}
/* }}} */
}
/* }}} */
-/* {{{ proto array H
TTPi_
Request::getOptions()
+/* {{{ proto array H
ttp
Request::getOptions()
*
* Get current set options.
*/
*
* Get current set options.
*/
-PHP_METHOD(H
TTPi_
Request, getOptions)
+PHP_METHOD(H
ttp
Request, getOptions)
{
zval *opts;
{
zval *opts;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
NO_ARGS;
NO_ARGS;
@@
-628,13
+626,13
@@
PHP_METHOD(HTTPi_Request, getOptions)
}
/* }}} */
}
/* }}} */
-/* {{{ proto void H
TTPi_
Request::unsetOptions()
+/* {{{ proto void H
ttp
Request::unsetOptions()
*
* Unset all options/headers/cookies.
*/
*
* Unset all options/headers/cookies.
*/
-PHP_METHOD(H
TTPi_
Request, unsetOptions)
+PHP_METHOD(H
ttp
Request, unsetOptions)
{
{
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
NO_ARGS;
NO_ARGS;
@@
-643,14
+641,14
@@
PHP_METHOD(HTTPi_Request, unsetOptions)
}
/* }}} */
}
/* }}} */
-/* {{{ proto bool H
TTPi_
Request::addHeader(array header)
+/* {{{ proto bool H
ttp
Request::addHeader(array header)
*
* Add (a) request header name/value pair(s).
*/
*
* Add (a) request header name/value pair(s).
*/
-PHP_METHOD(H
TTPi_
Request, addHeader)
+PHP_METHOD(H
ttp
Request, addHeader)
{
zval *opts, **headers, *new_headers;
{
zval *opts, **headers, *new_headers;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &new_headers)) {
RETURN_FALSE;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &new_headers)) {
RETURN_FALSE;
@@
-669,14
+667,14
@@
PHP_METHOD(HTTPi_Request, addHeader)
}
/* }}} */
}
/* }}} */
-/* {{{ proto bool H
TTPi_
Request::addCookie(array cookie)
+/* {{{ proto bool H
ttp
Request::addCookie(array cookie)
*
* Add (a) cookie(s).
*/
*
* Add (a) cookie(s).
*/
-PHP_METHOD(H
TTPi_
Request, addCookie)
+PHP_METHOD(H
ttp
Request, addCookie)
{
zval *opts, **cookies, *new_cookies;
{
zval *opts, **cookies, *new_cookies;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &new_cookies)) {
RETURN_FALSE;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a/", &new_cookies)) {
RETURN_FALSE;
@@
-695,15
+693,15
@@
PHP_METHOD(HTTPi_Request, addCookie)
}
/* }}} */
}
/* }}} */
-/* {{{ proto bool H
TTPi_
Request::setURL(string url)
+/* {{{ proto bool H
ttp
Request::setURL(string url)
*
* Set the request URL.
*/
*
* Set the request URL.
*/
-PHP_METHOD(H
TTPi_
Request, setURL)
+PHP_METHOD(H
ttp
Request, setURL)
{
char *URL = NULL;
int URL_len;
{
char *URL = NULL;
int URL_len;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &URL, &URL_len)) {
RETURN_FALSE;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &URL, &URL_len)) {
RETURN_FALSE;
@@
-714,14
+712,14
@@
PHP_METHOD(HTTPi_Request, setURL)
}
/* }}} */
}
/* }}} */
-/* {{{ proto string H
TTPi_
Request::getUrl()
+/* {{{ proto string H
ttp
Request::getUrl()
*
* Get the previously set request URL.
*/
*
* Get the previously set request URL.
*/
-PHP_METHOD(H
TTPi_
Request, getURL)
+PHP_METHOD(H
ttp
Request, getURL)
{
zval *URL;
{
zval *URL;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
NO_ARGS;
NO_ARGS;
@@
-730,15
+728,15
@@
PHP_METHOD(HTTPi_Request, getURL)
}
/* }}} */
}
/* }}} */
-/* {{{ proto bool H
TTPi_
Request::setMethod(long request_method)
+/* {{{ proto bool H
ttp
Request::setMethod(long request_method)
*
* Set the request methods; one of the <tt>HTTP_HEAD</tt>, <tt>HTTP_GET</tt> or
* <tt>HTTP_POST</tt> constants.
*/
*
* Set the request methods; one of the <tt>HTTP_HEAD</tt>, <tt>HTTP_GET</tt> or
* <tt>HTTP_POST</tt> constants.
*/
-PHP_METHOD(H
TTPi_
Request, setMethod)
+PHP_METHOD(H
ttp
Request, setMethod)
{
long meth;
{
long meth;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &meth)) {
RETURN_FALSE;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &meth)) {
RETURN_FALSE;
@@
-749,14
+747,14
@@
PHP_METHOD(HTTPi_Request, setMethod)
}
/* }}} */
}
/* }}} */
-/* {{{ proto long H
TTPi_
Request::getMethod()
+/* {{{ proto long H
ttp
Request::getMethod()
*
* Get the previously set request method.
*/
*
* Get the previously set request method.
*/
-PHP_METHOD(H
TTPi_
Request, getMethod)
+PHP_METHOD(H
ttp
Request, getMethod)
{
zval *meth;
{
zval *meth;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
NO_ARGS;
NO_ARGS;
@@
-765,16
+763,16
@@
PHP_METHOD(HTTPi_Request, getMethod)
}
/* }}} */
}
/* }}} */
-/* {{{ proto bool H
TTPi_
Request::setContentType(string content_type)
+/* {{{ proto bool H
ttp
Request::setContentType(string content_type)
*
* Set the content type the post request should have.
* Use this only if you know what you're doing.
*/
*
* Set the content type the post request should have.
* Use this only if you know what you're doing.
*/
-PHP_METHOD(H
TTPi_
Request, setContentType)
+PHP_METHOD(H
ttp
Request, setContentType)
{
char *ctype;
int ct_len;
{
char *ctype;
int ct_len;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &ctype, &ct_len)) {
RETURN_FALSE;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &ctype, &ct_len)) {
RETURN_FALSE;
@@
-792,14
+790,14
@@
PHP_METHOD(HTTPi_Request, setContentType)
}
/* }}} */
}
/* }}} */
-/* {{{ proto string H
TTPi_
Request::getContentType()
+/* {{{ proto string H
ttp
Request::getContentType()
*
* Get the previously content type.
*/
*
* Get the previously content type.
*/
-PHP_METHOD(H
TTPi_
Request, getContentType)
+PHP_METHOD(H
ttp
Request, getContentType)
{
zval *ctype;
{
zval *ctype;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
NO_ARGS;
NO_ARGS;
@@
-808,17
+806,17
@@
PHP_METHOD(HTTPi_Request, getContentType)
}
/* }}} */
}
/* }}} */
-/* {{{ proto bool H
TTPi_
Request::setQueryData(mixed query_data)
+/* {{{ proto bool H
ttp
Request::setQueryData(mixed query_data)
*
* Set the URL query parameters to use.
* Overwrites previously set query parameters.
* Affects any request types.
*/
*
* Set the URL query parameters to use.
* Overwrites previously set query parameters.
* Affects any request types.
*/
-PHP_METHOD(H
TTPi_
Request, setQueryData)
+PHP_METHOD(H
ttp
Request, setQueryData)
{
zval *qdata;
char *query_data = NULL;
{
zval *qdata;
char *query_data = NULL;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &qdata)) {
RETURN_FALSE;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z", &qdata)) {
RETURN_FALSE;
@@
-839,14
+837,14
@@
PHP_METHOD(HTTPi_Request, setQueryData)
}
/* }}} */
}
/* }}} */
-/* {{{ proto string H
TTPi_
Request::getQueryData()
+/* {{{ proto string H
ttp
Request::getQueryData()
*
* Get the current query data in form of an urlencoded query string.
*/
*
* Get the current query data in form of an urlencoded query string.
*/
-PHP_METHOD(H
TTPi_
Request, getQueryData)
+PHP_METHOD(H
ttp
Request, getQueryData)
{
zval *qdata;
{
zval *qdata;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
NO_ARGS;
NO_ARGS;
@@
-855,16
+853,16
@@
PHP_METHOD(HTTPi_Request, getQueryData)
}
/* }}} */
}
/* }}} */
-/* {{{ proto bool H
TTPi_
Request::addQueryData(array query_params)
+/* {{{ proto bool H
ttp
Request::addQueryData(array query_params)
*
* Add parameters to the query parameter list.
* Affects any request type.
*/
*
* Add parameters to the query parameter list.
* Affects any request type.
*/
-PHP_METHOD(H
TTPi_
Request, addQueryData)
+PHP_METHOD(H
ttp
Request, addQueryData)
{
zval *qdata, *old_qdata;
char *query_data = NULL;
{
zval *qdata, *old_qdata;
char *query_data = NULL;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &qdata)) {
RETURN_FALSE;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &qdata)) {
RETURN_FALSE;
@@
-883,14
+881,14
@@
PHP_METHOD(HTTPi_Request, addQueryData)
}
/* }}} */
}
/* }}} */
-/* {{{ proto void H
TTPi_
Request::unsetQueryData()
+/* {{{ proto void H
ttp
Request::unsetQueryData()
*
* Clean the query parameters.
* Affects any request type.
*/
*
* Clean the query parameters.
* Affects any request type.
*/
-PHP_METHOD(H
TTPi_
Request, unsetQueryData)
+PHP_METHOD(H
ttp
Request, unsetQueryData)
{
{
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
NO_ARGS;
NO_ARGS;
@@
-898,15
+896,15
@@
PHP_METHOD(HTTPi_Request, unsetQueryData)
}
/* }}} */
}
/* }}} */
-/* {{{ proto bool H
TTPi_
Request::addPostData(array post_data)
+/* {{{ proto bool H
ttp
Request::addPostData(array post_data)
*
* Adds POST data entries.
* Affects only POST requests.
*/
*
* Adds POST data entries.
* Affects only POST requests.
*/
-PHP_METHOD(H
TTPi_
Request, addPostData)
+PHP_METHOD(H
ttp
Request, addPostData)
{
zval *post, *post_data;
{
zval *post, *post_data;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &post_data)) {
RETURN_FALSE;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &post_data)) {
RETURN_FALSE;
@@
-919,16
+917,16
@@
PHP_METHOD(HTTPi_Request, addPostData)
}
/* }}} */
}
/* }}} */
-/* {{{ proto bool H
TTPi_
Request::setPostData(array post_data)
+/* {{{ proto bool H
ttp
Request::setPostData(array post_data)
*
* Set the POST data entries.
* Overwrites previously set POST data.
* Affects only POST requests.
*/
*
* Set the POST data entries.
* Overwrites previously set POST data.
* Affects only POST requests.
*/
-PHP_METHOD(H
TTPi_
Request, setPostData)
+PHP_METHOD(H
ttp
Request, setPostData)
{
zval *post, *post_data;
{
zval *post, *post_data;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &post_data)) {
RETURN_FALSE;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "a", &post_data)) {
RETURN_FALSE;
@@
-942,14
+940,14
@@
PHP_METHOD(HTTPi_Request, setPostData)
}
/* }}}*/
}
/* }}}*/
-/* {{{ proto array H
TTPi_
Request::getPostData()
+/* {{{ proto array H
ttp
Request::getPostData()
*
* Get previously set POST data.
*/
*
* Get previously set POST data.
*/
-PHP_METHOD(H
TTPi_
Request, getPostData)
+PHP_METHOD(H
ttp
Request, getPostData)
{
zval *post_data;
{
zval *post_data;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
NO_ARGS;
NO_ARGS;
@@
-959,15
+957,15
@@
PHP_METHOD(HTTPi_Request, getPostData)
}
/* }}} */
}
/* }}} */
-/* {{{ proto void H
TTPi_
Request::unsetPostData()
+/* {{{ proto void H
ttp
Request::unsetPostData()
*
* Clean POST data entires.
* Affects only POST requests.
*/
*
* Clean POST data entires.
* Affects only POST requests.
*/
-PHP_METHOD(H
TTPi_
Request, unsetPostData)
+PHP_METHOD(H
ttp
Request, unsetPostData)
{
zval *post_data;
{
zval *post_data;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
NO_ARGS;
NO_ARGS;
@@
-976,17
+974,17
@@
PHP_METHOD(HTTPi_Request, unsetPostData)
}
/* }}} */
}
/* }}} */
-/* {{{ proto bool H
TTPi_
Request::addPostFile(string name, string file[, string content_type = "application/x-octetstream"])
+/* {{{ proto bool H
ttp
Request::addPostFile(string name, string file[, string content_type = "application/x-octetstream"])
*
* Add a file to the POST request.
* Affects only POST requests.
*/
*
* Add a file to the POST request.
* Affects only POST requests.
*/
-PHP_METHOD(H
TTPi_
Request, addPostFile)
+PHP_METHOD(H
ttp
Request, addPostFile)
{
zval *files, *entry;
char *name, *file, *type = NULL;
int name_len, file_len, type_len = 0;
{
zval *files, *entry;
char *name, *file, *type = NULL;
int name_len, file_len, type_len = 0;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s", &name, &name_len, &file, &file_len, &type, &type_len)) {
RETURN_FALSE;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s", &name, &name_len, &file, &file_len, &type, &type_len)) {
RETURN_FALSE;
@@
-1016,14
+1014,14
@@
PHP_METHOD(HTTPi_Request, addPostFile)
}
/* }}} */
}
/* }}} */
-/* {{{ proto array H
TTPi_
Request::getPostFiles()
+/* {{{ proto array H
ttp
Request::getPostFiles()
*
* Get all previously added POST files.
*/
*
* Get all previously added POST files.
*/
-PHP_METHOD(H
TTPi_
Request, getPostFiles)
+PHP_METHOD(H
ttp
Request, getPostFiles)
{
zval *files;
{
zval *files;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
NO_ARGS;
NO_ARGS;
@@
-1034,15
+1032,15
@@
PHP_METHOD(HTTPi_Request, getPostFiles)
}
/* }}} */
}
/* }}} */
-/* {{{ proto void H
TTPi_
Request::unsetPostFiles()
+/* {{{ proto void H
ttp
Request::unsetPostFiles()
*
* Unset the POST files list.
* Affects only POST requests.
*/
*
* Unset the POST files list.
* Affects only POST requests.
*/
-PHP_METHOD(H
TTPi_
Request, unsetPostFiles)
+PHP_METHOD(H
ttp
Request, unsetPostFiles)
{
zval *files;
{
zval *files;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
NO_ARGS;
NO_ARGS;
@@
-1051,14
+1049,14
@@
PHP_METHOD(HTTPi_Request, unsetPostFiles)
}
/* }}} */
}
/* }}} */
-/* {{{ proto array H
TTPi_
Request::getResponseData()
+/* {{{ proto array H
ttp
Request::getResponseData()
*
* Get all response data after the request has been sent.
*/
*
* Get all response data after the request has been sent.
*/
-PHP_METHOD(H
TTPi_
Request, getResponseData)
+PHP_METHOD(H
ttp
Request, getResponseData)
{
zval *data;
{
zval *data;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
NO_ARGS;
NO_ARGS;
@@
-1068,16
+1066,16
@@
PHP_METHOD(HTTPi_Request, getResponseData)
}
/* }}} */
}
/* }}} */
-/* {{{ proto string H
TTPi_
Request::getResponseHeader([string name])
+/* {{{ proto string H
ttp
Request::getResponseHeader([string name])
*
* Get response header(s) after the request has been sent.
*/
*
* Get response header(s) after the request has been sent.
*/
-PHP_METHOD(H
TTPi_
Request, getResponseHeader)
+PHP_METHOD(H
ttp
Request, getResponseHeader)
{
zval *data, **headers, **header;
char *header_name = NULL;
int header_len = 0;
{
zval *data, **headers, **header;
char *header_name = NULL;
int header_len = 0;
- getObject(http
i
_response_object, obj);
+ getObject(http_response_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &header_name, &header_len)) {
RETURN_FALSE;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &header_name, &header_len)) {
RETURN_FALSE;
@@
-1098,14
+1096,14
@@
PHP_METHOD(HTTPi_Request, getResponseHeader)
}
}
}
}
-/* {{{ proto string H
TTPi_
Request::getResponseBody()
+/* {{{ proto string H
ttp
Request::getResponseBody()
*
* Get the response body after the request has been sent.
*/
*
* Get the response body after the request has been sent.
*/
-PHP_METHOD(H
TTPi_
Request, getResponseBody)
+PHP_METHOD(H
ttp
Request, getResponseBody)
{
zval *data, **body;
{
zval *data, **body;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
NO_ARGS;
NO_ARGS;
@@
-1118,14
+1116,14
@@
PHP_METHOD(HTTPi_Request, getResponseBody)
}
/* }}} */
}
/* }}} */
-/* {{{ proto int H
TTPi_
Request::getResponseCode()
+/* {{{ proto int H
ttp
Request::getResponseCode()
*
* Get the response code after the request has been sent.
*/
*
* Get the response code after the request has been sent.
*/
-PHP_METHOD(H
TTPi_
Request, getResponseCode)
+PHP_METHOD(H
ttp
Request, getResponseCode)
{
zval **code, **hdrs, *data;
{
zval **code, **hdrs, *data;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
NO_ARGS;
NO_ARGS;
@@
-1140,17
+1138,17
@@
PHP_METHOD(HTTPi_Request, getResponseCode)
}
/* }}} */
}
/* }}} */
-/* {{{ proto array H
TTPi_
Request::getResponseInfo([string name])
+/* {{{ proto array H
ttp
Request::getResponseInfo([string name])
*
* Get response info after the request has been sent.
* See http_get() for a full list of returned info.
*/
*
* Get response info after the request has been sent.
* See http_get() for a full list of returned info.
*/
-PHP_METHOD(H
TTPi_
Request, getResponseInfo)
+PHP_METHOD(H
ttp
Request, getResponseInfo)
{
zval *info, **infop;
char *info_name = NULL;
int info_len = 0;
{
zval *info, **infop;
char *info_name = NULL;
int info_len = 0;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &info_name, &info_len)) {
RETURN_FALSE;
if (SUCCESS != zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|s", &info_name, &info_len)) {
RETURN_FALSE;
@@
-1172,14
+1170,14
@@
PHP_METHOD(HTTPi_Request, getResponseInfo)
}
/* }}}*/
}
/* }}}*/
-/* {{{ proto bool H
TTPi_
Request::send()
+/* {{{ proto bool H
ttp
Request::send()
*
* Send the HTTP request.
*
* GET example:
* <pre>
* <?php
*
* Send the HTTP request.
*
* GET example:
* <pre>
* <?php
- * $r = new H
TTPi_
Request('http://example.com/feed.rss', HTTP_GET);
+ * $r = new H
ttp
Request('http://example.com/feed.rss', HTTP_GET);
* $r->setOptions(array('lastmodified' => filemtime('local.rss')));
* $r->addQueryData(array('category' => 3));
* if ($r->send() && $r->getResponseCode() == 200) {
* $r->setOptions(array('lastmodified' => filemtime('local.rss')));
* $r->addQueryData(array('category' => 3));
* if ($r->send() && $r->getResponseCode() == 200) {
@@
-1191,7
+1189,7
@@
PHP_METHOD(HTTPi_Request, getResponseInfo)
* POST example:
* <pre>
* <?php
* POST example:
* <pre>
* <?php
- * $r = new H
TTPi_
Request('http://example.com/form.php', HTTP_POST);
+ * $r = new H
ttp
Request('http://example.com/form.php', HTTP_POST);
* $r->setOptions(array('cookies' => array('lang' => 'de')));
* $r->addPostData(array('user' => 'mike', 'pass' => 's3c|r3t'));
* $r->addPostFile('image', 'profile.jpg', 'image/jpeg');
* $r->setOptions(array('cookies' => array('lang' => 'de')));
* $r->addPostData(array('user' => 'mike', 'pass' => 's3c|r3t'));
* $r->addPostFile('image', 'profile.jpg', 'image/jpeg');
@@
-1201,13
+1199,13
@@
PHP_METHOD(HTTPi_Request, getResponseInfo)
* ?>
* </pre>
*/
* ?>
* </pre>
*/
-PHP_METHOD(H
TTPi_
Request, send)
+PHP_METHOD(H
ttp
Request, send)
{
STATUS status = FAILURE;
zval *meth, *URL, *qdata, *opts, *info, *resp;
char *response_data, *request_uri;
size_t response_len;
{
STATUS status = FAILURE;
zval *meth, *URL, *qdata, *opts, *info, *resp;
char *response_data, *request_uri;
size_t response_len;
- getObject(http
i
_request_object, obj);
+ getObject(http_request_object, obj);
NO_ARGS;
NO_ARGS;