<channel>pecl.php.net</channel>
<summary>Extended HTTP Support</summary>
<description><![CDATA[
-Extended HTTP support. Again. Keep in mind that it's got the major version 2, because it's incompatible with pecl_http v1.
+This HTTP extension aims to provide a convenient and powerful
+set of functionality for one of PHPs major applications.
-* Introduces the http namespace.
-* Message bodies have been remodeled to use PHP temporary streams instead of in-memory buffers.
-* The utterly misunderstood HttpResponse class has been reimplemented as http\Env\Response inheriting http\Message.
-* Currently, there's only one Exception class left, http\Exception.
-* Errors triggered by the extension can be configured statically by http\Object::$defaultErrorHandling or inherited http\Object->errorHandling.
-* The request ecosystem has been modularized to support different libraries, though for the moment only libcurl is supported.
+It eases handling of HTTP urls, headers and messages, provides
+means for negotiation of a client's preferred content type,
+language and charset, as well as a convenient way to send any
+arbitrary data with caching and resuming capabilities.
+
+It provides powerful request functionality, if built with CURL
+support. Parallel requests are available for PHP 5 and greater.
]]></description>
<lead>
<name>Michael Wallner</name>
<api>beta</api>
</stability>
<license>BSD, revised</license>
- <notes><![CDATA[-
+ <notes><![CDATA[
+Extended HTTP support. Again. Keep in mind that it's got the major version 2, because it's incompatible with pecl_http v1.
+
+* Introduces the http namespace.
+* Message bodies have been remodeled to use PHP temporary streams instead of in-memory buffers.
+* The utterly misunderstood HttpResponse class has been reimplemented as http\Env\Response inheriting http\Message.
+* Currently, there's only one Exception class left, http\Exception.
+* Errors triggered by the extension can be configured statically by http\Object::$defaultErrorHandling or inherited http\Object->errorHandling.
+* The request ecosystem has been modularized to support different libraries, though for the moment only libcurl is supported.
]]></notes>
<contents>
<dir name="/">
*/
static HashTable php_http_client_drivers;
-PHP_HTTP_API STATUS php_http_client_driver_add(const char *name_str, uint name_len, php_http_client_driver_t *driver)
+PHP_HTTP_API STATUS php_http_client_driver_add(php_http_client_driver_t *driver)
{
- return zend_hash_add(&php_http_client_drivers, name_str, name_len + 1, (void *) driver, sizeof(php_http_client_driver_t), NULL);
+ return zend_hash_add(&php_http_client_drivers, driver->name_str, driver->name_len + 1, (void *) driver, sizeof(php_http_client_driver_t), NULL);
}
-PHP_HTTP_API STATUS php_http_client_driver_get(char **name_str, uint *name_len, php_http_client_driver_t *driver)
+PHP_HTTP_API STATUS php_http_client_driver_get(const char *name_str, size_t name_len, php_http_client_driver_t *driver)
{
php_http_client_driver_t *tmp;
- if (*name_str && SUCCESS == zend_hash_find(&php_http_client_drivers, *name_str, (*name_len) + 1, (void *) &tmp)) {
- *driver = *tmp;
- return SUCCESS;
- } else if (SUCCESS == zend_hash_get_current_data(&php_http_client_drivers, (void *) &tmp)) {
- zend_hash_get_current_key_ex(&php_http_client_drivers, name_str, name_len, NULL, 0, NULL);
- --(*name_len);
+ if ((name_str && SUCCESS == zend_hash_find(&php_http_client_drivers, name_str, name_len + 1, (void *) &tmp))
+ || (SUCCESS == zend_hash_get_current_data(&php_http_client_drivers, (void *) &tmp))) {
*driver = *tmp;
return SUCCESS;
}
return FAILURE;
}
+static int apply_driver_list(void *p, void *arg TSRMLS_DC)
+{
+ php_http_client_driver_t *d = p;
+ zval *zname;
+
+ MAKE_STD_ZVAL(zname);
+ ZVAL_STRINGL(zname, d->name_str, d->name_len, 1);
+
+ zend_hash_next_index_insert(arg, &zname, sizeof(zval *), NULL);
+ return ZEND_HASH_APPLY_KEEP;
+}
+
+PHP_HTTP_API void php_http_client_driver_list(HashTable *ht TSRMLS_DC)
+{
+ zend_hash_apply_with_argument(&php_http_client_drivers, apply_driver_list, ht TSRMLS_CC);
+}
+
void php_http_client_options_set_subr(zval *this_ptr, char *key, size_t len, zval *opts, int overwrite TSRMLS_DC)
{
if (overwrite || (opts && zend_hash_num_elements(Z_ARRVAL_P(opts)))) {
return SUCCESS;
}
-static void handle_progress(void *arg, php_http_client_t *client, php_http_client_enqueue_t *e, php_http_client_progress_state_t *state)
+static void handle_progress(void *arg, php_http_client_t *client, php_http_client_enqueue_t *e, php_http_client_progress_state_t *progress)
{
- zval *zrequest, *retval = NULL, *zclient;
+ zval *zrequest, *zprogress, *retval = NULL, *zclient;
TSRMLS_FETCH_FROM_CTX(client->ts);
MAKE_STD_ZVAL(zclient);
ZVAL_OBJVAL(zclient, ((php_http_client_object_t *) arg)->zv, 1);
MAKE_STD_ZVAL(zrequest);
ZVAL_OBJVAL(zrequest, ((php_http_message_object_t *) e->opaque)->zv, 1);
+ MAKE_STD_ZVAL(zprogress);
+ object_init(zprogress);
+ add_property_bool(zprogress, "started", progress->started);
+ add_property_bool(zprogress, "finished", progress->finished);
+ add_property_string(zprogress, "info", STR_PTR(progress->info), 1);
+ add_property_double(zprogress, "dltotal", progress->dl.total);
+ add_property_double(zprogress, "dlnow", progress->dl.now);
+ add_property_double(zprogress, "ultotal", progress->ul.total);
+ add_property_double(zprogress, "ulnow", progress->ul.now);
with_error_handling(EH_NORMAL, NULL) {
- zend_call_method_with_1_params(&zclient, NULL, NULL, "notify", &retval, zrequest);
+ zend_call_method_with_2_params(&zclient, NULL, NULL, "notify", &retval, zrequest, zprogress);
} end_error_handling();
zval_ptr_dtor(&zclient);
zval_ptr_dtor(&zrequest);
+ zval_ptr_dtor(&zprogress);
if (retval) {
zval_ptr_dtor(&retval);
}
if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|ss", &driver_str, &driver_len, &persistent_handle_str, &persistent_handle_len)) {
php_http_client_driver_t driver;
- if (SUCCESS == php_http_client_driver_get(&driver_str, (uint *) &driver_len, &driver)) {
+ if (SUCCESS == php_http_client_driver_get(driver_str, driver_len, &driver)) {
php_resource_factory_t *rf = NULL;
php_http_client_object_t *obj = zend_object_store_get_object(getThis() TSRMLS_CC);
zval *os;
size_t name_len;
php_persistent_handle_factory_t *pf;
- name_len = spprintf(&name_str, 0, "http\\Client\\%s", php_http_pretty_key(driver_str, driver_len, 1, 1));
+ name_len = spprintf(&name_str, 0, "http\\Client\\%s", driver.name_str);
+ php_http_pretty_key(name_str + sizeof("http\\Client"), driver.name_len, 1, 1);
if ((pf = php_persistent_handle_concede(NULL , name_str, name_len, persistent_handle_str, persistent_handle_len, NULL, NULL TSRMLS_CC))) {
rf = php_resource_factory_init(NULL, php_persistent_handle_get_resource_factory_ops(), pf, (void (*)(void *)) php_persistent_handle_abandon);
}
if (z_roptions) {
if (Z_TYPE_P(z_roptions) == IS_ARRAY) {
- array_join(Z_ARRVAL_P(z_roptions), options, 1, 0);
+ array_join(Z_ARRVAL_P(z_roptions), options, 0, 0);
}
zval_ptr_dtor(&z_roptions);
}
static int notify(zend_object_iterator *iter, void *puser TSRMLS_DC)
{
- zval **observer = NULL, **args = puser;
+ zval **observer = NULL, ***args = puser;
iter->funcs->get_current_data(iter, &observer TSRMLS_CC);
if (observer) {
- zval *retval = NULL;
-
- zend_call_method(observer, NULL, NULL, ZEND_STRL("update"), &retval, args[1]?2:1, args[0], args[1] TSRMLS_CC);
- if (retval) {
- zval_ptr_dtor(&retval);
- }
-
- return SUCCESS;
+ return php_http_method_call(*observer, ZEND_STRL("update"), args[2]?3:args[1]?2:args[0]?1:0, args, NULL TSRMLS_CC);
}
return FAILURE;
}
ZEND_END_ARG_INFO();
static PHP_METHOD(HttpClient, notify)
{
- zval *request = NULL;
+ zval *request = NULL, *zprogress = NULL;
- if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|O!", &request, php_http_client_request_get_class_entry())) {
- zval *args[2], *observers = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("observers"), 0 TSRMLS_CC);
+ if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|O!o!", &request, php_http_client_request_get_class_entry(), &zprogress)) {
+ zval **args[3], *observers = zend_read_property(php_http_client_class_entry, getThis(), ZEND_STRL("observers"), 0 TSRMLS_CC);
if (Z_TYPE_P(observers) == IS_OBJECT) {
Z_ADDREF_P(getThis());
+ args[0] = &getThis();
if (request) {
Z_ADDREF_P(request);
}
- args[0] = getThis();
- args[1] = request;
- spl_iterator_apply(observers, notify, &args TSRMLS_CC);
+ args[1] = &request;
+ if (zprogress) {
+ Z_ADDREF_P(zprogress);
+ }
+ args[2] = &zprogress;
+ spl_iterator_apply(observers, notify, args TSRMLS_CC);
zval_ptr_dtor(&getThis());
if (request) {
zval_ptr_dtor(&request);
}
+ if (zprogress) {
+ zval_ptr_dtor(&zprogress);
+ }
}
}
}
}
+ZEND_BEGIN_ARG_INFO_EX(ai_HttpClient_getAvailableDrivers, 0, 0, 0)
+ZEND_END_ARG_INFO();
+static PHP_METHOD(HttpClient, getAvailableDrivers) {
+ if (SUCCESS == zend_parse_parameters_none()) {
+ array_init(return_value);
+ php_http_client_driver_list(Z_ARRVAL_P(return_value) TSRMLS_CC);
+ }
+}
+
static zend_function_entry php_http_client_methods[] = {
PHP_ME(HttpClient, __construct, ai_HttpClient_construct, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR)
PHP_ME(HttpClient, reset, ai_HttpClient_reset, ZEND_ACC_PUBLIC)
PHP_ME(HttpClient, setCookies, ai_HttpClient_setCookies, ZEND_ACC_PUBLIC)
PHP_ME(HttpClient, addCookies, ai_HttpClient_addCookies, ZEND_ACC_PUBLIC)
PHP_ME(HttpClient, getCookies, ai_HttpClient_getCookies, ZEND_ACC_PUBLIC)
+ PHP_ME(HttpClient, getAvailableDrivers, ai_HttpClient_getAvailableDrivers, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
EMPTY_FUNCTION_ENTRY
};
} php_http_client_ops_t;
typedef struct php_http_client_driver {
+ const char *name_str;
+ size_t name_len;
php_http_client_ops_t *client_ops;
} php_http_client_driver_t;
-PHP_HTTP_API STATUS php_http_client_driver_add(const char *name_str, uint name_len, php_http_client_driver_t *driver);
-PHP_HTTP_API STATUS php_http_client_driver_get(char **name_str, uint *name_len, php_http_client_driver_t *driver);
+PHP_HTTP_API STATUS php_http_client_driver_add(php_http_client_driver_t *driver);
+PHP_HTTP_API STATUS php_http_client_driver_get(const char *name_str, size_t name_len, php_http_client_driver_t *driver);
typedef struct php_http_client_progress_state {
struct {
{
php_http_options_t *options;
php_http_client_driver_t driver = {
+ ZEND_STRL("curl"),
&php_http_client_curl_ops
};
- if (SUCCESS != php_http_client_driver_add(ZEND_STRL("curl"), &driver)) {
+ if (SUCCESS != php_http_client_driver_add(&driver)) {
return FAILURE;
}
va_end(args);
}
+/* ZEND */
+
+STATUS php_http_method_call(zval *object, const char *method_str, size_t method_len, int argc, zval **argv[], zval **retval_ptr TSRMLS_DC)
+{
+ zend_fcall_info fci;
+ zval zmethod;
+ zval *retval;
+ STATUS rv;
+
+ fci.size = sizeof(fci);
+ fci.object_ptr = object;
+ fci.function_name = &zmethod;
+ fci.retval_ptr_ptr = retval_ptr ? retval_ptr : &retval;
+ fci.param_count = argc;
+ fci.params = argv;
+ fci.no_separation = 1;
+ fci.symbol_table = NULL;
+ fci.function_table = NULL;
+
+ INIT_PZVAL(&zmethod);
+ ZVAL_STRINGL(&zmethod, method_str, method_len, 0);
+ rv = zend_call_function(&fci, NULL TSRMLS_CC);
+
+ if (!retval_ptr && retval) {
+ zval_ptr_dtor(&retval);
+ }
+ return rv;
+}
/*
* Local variables:
* tab-width: 4
return FAILURE;
}
+STATUS php_http_method_call(zval *object, const char *method_str, size_t method_len, int argc, zval **argv[], zval **retval_ptr TSRMLS_DC);
+
/* return bool (v == SUCCESS) */
#define RETVAL_SUCCESS(v) RETVAL_BOOL(SUCCESS == (v))
#define RETURN_SUCCESS(v) RETURN_BOOL(SUCCESS == (v))
--- /dev/null
+--TEST--
+client drivers
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+echo "Test\n";
+
+foreach (http\Client::getAvailableDrivers() as $driver) {
+ $client = new http\Client($driver);
+ var_dump($client instanceof http\Client);
+}
+
+?>
+Done
+--EXPECTREGEX--
+Test
+(?:bool\(true\)
+)+Done
--- /dev/null
+--TEST--
+client observer
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+echo "Test\n";
+
+class Observer implements SplObserver
+{
+ function update(SplSubject $client, http\Client\Request $request = null, StdClass $progress = null) {
+ echo "P";
+ if ($client->getProgressInfo($request) != $progress) {
+ var_dump($progress);
+ }
+ }
+}
+
+$observer = new Observer;
+$request = new http\Client\Request("GET", "http://www.example.org/");
+
+foreach (http\Client::getAvailableDrivers() as $driver) {
+ $client = new http\Client($driver);
+ $client->attach($observer);
+ $client->enqueue($request);
+ $client->send();
+}
+
+?>
+
+Done
+--EXPECTREGEX--
+Test
+P+
+Done
--- /dev/null
+--TEST--
+client once & wait
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+echo "Test\n";
+
+$request = new http\Client\Request("GET", "http://www.example.org/");
+
+foreach (http\Client::getAvailableDrivers() as $driver) {
+ $client = new http\Client($driver);
+ $client->enqueue($request);
+
+ while ($client->once()) {
+ $client->wait(.1);
+ }
+
+ if (!$client->getResponse()) {
+ var_dump($client);
+ }
+}
+?>
+Done
+--EXPECT--
+Test
+Done
--- /dev/null
+--TEST--
+client reset
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+echo "Test\n";
+
+$request = new http\Client\Request("GET", "http://www.example.org");
+
+foreach (http\Client::getAvailableDrivers() as $driver) {
+ $client = new http\Client($driver);
+ $client->enqueue($request)->send();
+ if (!($client->getResponse($request) instanceof http\Client\Response)) {
+ var_dump($client);
+ }
+ try {
+ $client->enqueue($request);
+ } catch (Exception $e) {
+ echo $e->getMessage(),"\n";
+ }
+ $client->reset();
+ if (($response = $client->getResponse())) {
+ var_dump($response);
+ }
+ $client->enqueue($request);
+}
+?>
+Done
+--EXPECTREGEX--
+Test
+(?:Failed to enqueue request; request already in queue
+)+Done
--- /dev/null
+--TEST--
+client response callback
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+echo "Test\n";
+
+foreach (http\Client::getAvailableDrivers() as $driver) {
+ $client = new http\Client($driver);
+ $client->enqueue(new http\Client\Request("GET", "http://www.example.org"), function($response) {
+ echo "R\n";
+ if (!($response instanceof http\Client\Response)) {
+ var_dump($response);
+ }
+ });
+ $client->send();
+}
+
+?>
+Done
+--EXPECTREGEX--
+Test
+(?:R
+)+Done
--- /dev/null
+--TEST--
+client response callback + dequeue
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+echo "Test\n";
+
+function response($response) {
+ echo "R\n";
+ if (!($response instanceof http\Client\Response)) {
+ var_dump($response);
+ }
+
+ /* automatically dequeue */
+ return true;
+}
+
+$request = new http\Client\Request("GET", "http://www.example.org");
+
+foreach (http\Client::getAvailableDrivers() as $driver) {
+ $client = new http\Client($driver);
+ for ($i=0; $i < 2; ++ $i) {
+ $client->enqueue($request, "response");
+ $client->send();
+ try {
+ $client->dequeue($request);
+ } catch (Exception $e) {
+ echo $e->getMessage(),"\n";
+ }
+ }
+}
+
+?>
+Done
+--EXPECTREGEX--
+Test
+(?:(?:R
+Failed to dequeue request; request not in queue
+)+)+Done
--- /dev/null
+--TEST--
+client response callback + requeue
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+echo "Test\n";
+
+function response($response) {
+ echo "R\n";
+ if (!($response instanceof http\Client\Response)) {
+ var_dump($response);
+ }
+}
+
+$request = new http\Client\Request("GET", "http://www.example.org");
+
+foreach (http\Client::getAvailableDrivers() as $driver) {
+ $client = new http\Client($driver);
+ for ($i=0; $i < 2; ++ $i) {
+ $client->requeue($request, "response");
+ $client->send();
+ }
+}
+
+?>
+Done
+--EXPECTREGEX--
+Test
+(?:R
+R
+)+Done
--- /dev/null
+--TEST--
+client features
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+echo "Test\n";
+
+$request = new http\Client\Request("GET", "http://www.example.org");
+
+foreach (http\Client::getAvailableDrivers() as $driver) {
+ $client = new http\Client($driver);
+ $client->enablePipelining(true);
+ $client->enableEvents(true);
+
+ $client->enqueue($request);
+ $client->enqueue(clone $request);
+ $client->enqueue(clone $request);
+
+ $client->send();
+
+ while ($client->getResponse()) {
+ echo "R\n";
+ }
+}
+
+?>
+Done
+--EXPECTREGEX--
+Test
+(?:R
+R
+R
+)+Done
--- /dev/null
+--TEST--
+client static cookies
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+echo "Test\n";
+
+$request = new http\Client\Request("GET", "http://dev.iworks.at/ext-http/.print_request.php");
+
+function x($a) {
+ $r[key($a)]=end($a);
+ $r[key($a)]=reset($a);
+ return $r;
+}
+foreach (http\Client::getAvailableDrivers() as $driver) {
+ $client = new http\Client($driver);
+ $client->setCookies(array("test" => "bar"));
+ $client->addCookies(array("foo" => "test"));
+ $client->enqueue($request);
+ $client->send();
+ var_dump($client->getResponse()->getBody()->toString());
+ $request->setOptions(array("cookies" => x($client->getCookies())));
+ $client->requeue($request);
+ $client->send();
+ var_dump($client->getResponse()->getBody()->toString());
+}
+
+?>
+Done
+--EXPECTREGEX--
+Test
+(?:string\(46\) "Array
+\(
+ \[test\] \=\> bar
+ \[foo\] \=\> test
+\)
+"
+string\(46\) "Array
+\(
+ \[test\] \=\> test
+ \[foo\] \=\> bar
+\)
+"
+)+Done
--- /dev/null
+--TEST--
+client upload
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+echo "Test\n";
+
+$request = new http\Client\Request("POST", "http://dev.iworks.at/ext-http/.print_request.php");
+$request->getBody()->addForm(null, array("file"=>__FILE__, "name"=>"upload", "type"=>"text/plain"));
+
+foreach (http\Client::getAvailableDrivers() as $driver) {
+ $client = new http\Client($driver);
+ $client->enqueue($request)->send();
+ var_dump($client->getResponse()->getBody()->toString());
+}
+?>
+Done
+--EXPECTREGEX--
+Test
+(?:string\(\d+\) "Array
+\(
+ \[upload\] \=\> Array
+ \(
+ \[name\] \=\> client010\.php
+ \[type\] \=\> text\/plain
+ \[tmp_name\] \=\> .*
+ \[error\] \=\> 0
+ \[size\] \=\> \d+
+ \)
+
+\)
+"
+)+Done
--- /dev/null
+--TEST--
+client response cookie
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+echo "Test\n";
+
+$request = new http\Client\Request("GET", "http://dev.iworks.at/ext-http/.cookie1.php");
+
+foreach (http\Client::getAvailableDrivers() as $driver) {
+ $client = new http\Client($driver);
+ foreach($client->enqueue($request)->send()->getResponse()->getCookies(0, array("comment")) as $cookies) {
+ var_dump($cookies->toArray());
+ }
+}
+?>
+Done
+--EXPECTREGEX--
+Test
+(?:array\(7\) \{
+ \["cookies"\]\=\>
+ array\(2\) \{
+ \["foo"\]\=\>
+ string\(3\) "bar"
+ \["bar"\]\=\>
+ string\(3\) "foo"
+ \}
+ \["extras"\]\=\>
+ array\(0\) \{
+ \}
+ \["flags"\]\=\>
+ int\(0\)
+ \["expires"\]\=\>
+ int\(\-1\)
+ \["max\-age"\]\=\>
+ int\(\-1\)
+ \["path"\]\=\>
+ string\(0\) ""
+ \["domain"\]\=\>
+ string\(0\) ""
+\}
+)+Done
--- /dev/null
+--TEST--
+client response cookies
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+echo "Test\n";
+
+$request = new http\Client\Request("GET", "http://dev.iworks.at/ext-http/.cookie.php");
+
+foreach (http\Client::getAvailableDrivers() as $driver) {
+ $client = new http\Client($driver);
+ foreach($client->enqueue($request)->send()->getResponse()->getCookies(0, array("comment")) as $cookies) {
+ var_dump($cookies->toArray());
+ }
+}
+?>
+Done
+--EXPECTREGEX--
+Test
+(?:array\(7\) \{
+ \["cookies"\]\=\>
+ array\(1\) \{
+ \["temp"\]\=\>
+ string\(13\) "\d+\.\d+"
+ \}
+ \["extras"\]\=\>
+ array\(0\) \{
+ \}
+ \["flags"\]\=\>
+ int\(0\)
+ \["expires"\]\=\>
+ int\(\-1\)
+ \["max\-age"\]\=\>
+ int\(\-1\)
+ \["path"\]\=\>
+ string\(0\) ""
+ \["domain"\]\=\>
+ string\(0\) ""
+\}
+array\(7\) \{
+ \["cookies"\]\=\>
+ array\(1\) \{
+ \["perm"\]\=\>
+ string\(13\) "\d+\.\d+"
+ \}
+ \["extras"\]\=\>
+ array\(0\) \{
+ \}
+ \["flags"\]\=\>
+ int\(0\)
+ \["expires"\]\=\>
+ int\(\d+\)
+ \["max\-age"\]\=\>
+ int\(\-1\)
+ \["path"\]\=\>
+ string\(0\) ""
+ \["domain"\]\=\>
+ string\(0\) ""
+\}
+)+Done
--- /dev/null
+--TEST--
+client response transfer info
+--SKIPIF--
+<?php
+include "skipif.inc";
+?>
+--FILE--
+<?php
+echo "Test\n";
+
+$request = new http\Client\Request("GET", "http://www.example.org");
+
+foreach (http\Client::getAvailableDrivers() as $driver) {
+ $client = new http\Client($driver);
+ $response = $client->enqueue($request)->send()->getResponse();
+ var_dump($response->getTransferInfo("response_code"));
+ var_dump(count($response->getTransferInfo()));
+}
+?>
+Done
+--EXPECTREGEX--
+Test
+(?:int\([1-5]\d\d\)
+int\(\d\d\)
+)+Done
--TEST--
-http\Env\Request grabbing $_FILES
+env request grabbing $_FILES
--SKIPIF--
<?php include "skipif.inc"; ?>
--POST_RAW--
--TEST--
-http\Env\Request grabbing $_FILES from array
+env request grabbing $_FILES from array
--SKIPIF--
<?php include "skipif.inc"; ?>
--POST_RAW--
--TEST--
-http\Env\Request getForm
+env request form
--SKIPIF--
<?php include "skipif.inc"; ?>
--POST--
--TEST--
-http\Env\Request getQuery
+env request query
--SKIPIF--
<?php include "skipif.inc"; ?>
--GET--
--TEST--
-http\Env response codes
+env response codes
--SKIPIF--
<?php include "skipif.inc"; ?>
--FILE--
--TEST--
-Message
+message
--SKIPIF--
<?php
include "skipif.inc";
--TEST--
-http\QueryString
+query string
--SKIPIF--
<?php
include("skipif.inc");