Source code for file /openid/Services/Yadis/ParanoidHTTPFetcher.php
Documentation is available at ParanoidHTTPFetcher.php
* This module contains the CURL-based HTTP fetcher implementation.
* LICENSE: See the COPYING file included in this distribution.
* @copyright 2005 Janrain, Inc.
* @license http://www.gnu.org/copyleft/lesser.html LGPL
require_once "Services/Yadis/HTTPFetcher.php";
* A paranoid {@link Services_Yadis_HTTPFetcher} class which uses CURL
$this->headers =
array();
function _writeHeader($ch, $header)
function _writeData($ch, $data)
function get($url, $extra_headers =
null)
$stop =
time() +
$this->timeout;
while ($redir &&
($off >
0)) {
if (!$this->allowedURL($url)) {
array(&$this, "_writeData"));
array(&$this, "_writeHeader"));
$headers =
$this->headers;
if (in_array($code, array(301, 302, 303, 307))) {
$url =
$this->_findRedirect($headers);
foreach ($headers as $header) {
list
($name, $value) =
explode(": ", $header, 2);
$new_headers[$name] =
$value;
function post($url, $body)
if (!$this->allowedURL($url)) {
array(&$this, "_writeData"));
foreach ($this->headers as $header) {
list
($name, $value) =
explode(": ", $header, 2);
$new_headers[$name] =
$value;