request = $request; } public function update(SplSubject $client, http\Client\Request $request = null, stdclass $progress = null) { if ($request !== $this->request) { return; } if ($progress->info === 'redirect') { throw new http\Exception\UnexpectedValueException('Unexpected redirect.'); } if ($progress->finished) { $response = $client->getResponse($request); foreach ($response->getHeaders() as $name => $value) { $value = (array) $value; foreach ($value as $v) { fprintf(STDERR, ">%s: %s<\n", $name, $v); } } } } } print(curl_version(). "\n"); $sProject = getenv('FitProject'); $r = new FetchableRequest('http://asdf.com'); $loader = new RequestLoader($r); $client = new http\Client('curl', '/'); $request = new http\Client\Request('GET', 'http://example.com', NULL, NULL); $request->setOptions(array ('headers_out' => 1, 'useragent' => FALSE, 'cookiesession' => FALSE)); $request->setOptions(array (68 => 20, 19913 => TRUE, 2 => TRUE, 'compress' => TRUE, 'ssl' => array ('capath' => '/etc/ssl/certs/', 'cainfo' => 'conf/ssl/dummyCA.pem', 'verifypeer' => TRUE, 'verifyhost' => TRUE), 'redirect' => 0, 'proxytype' => 0, 'proxyhost' => 'localhost', 'proxyport' => 14020, 'timeout' => 3, 'connecttimeout' => 3)); $observer = new xHTTPTransferObserver($request, $loader); $client->attach($observer); $client->enqueue($request); $request->getOptions(); $client->send(); $response = $client->getResponse($request); $ti = $response->getTransferInfo(); $a = get_object_vars($ti); print_r($a); // REQ 2 $client2 = new http\Client('curl', '/'); $req2 = new http\Client\Request('GET', 'http://example.com', NULL, NULL); $req2->setOptions(array ('headers_out' => 1, 'useragent' => FALSE, 'cookiesession' => FALSE)); $req2->setOptions(array (68 => 20, 19913 => TRUE, 2 => TRUE, 'compress' => TRUE, 'ssl' => array ('capath' => '/etc/ssl/certs/', 'cainfo' => '/home/canavan/FIT/trunk/conf/ssl/dummyCA.pem', 'verifypeer' => TRUE, 'verifyhost' => TRUE), 'redirect' => 0, 'proxytype' => 0, 'proxyhost' => 'localhost', 'proxyport' => 14020, 'proxyauth' => 'puser:ppass', 'proxyauthtype' => 8, 'timeout' => 3, 'connecttimeout' => 3)); $observer2 = new xHTTPTransferObserver($req2, $loader); $client2->attach($observer2); $client2->enqueue($req2); $req2->getOptions(); // segfault: $client2->send(); $response = $client->getResponse($request); $ti = $response->getTransferInfo(); $a = get_object_vars($ti); print_r($a);