本文整理汇总了PHP中HTTPClient::getHTTPClient方法的典型用法代码示例。如果您正苦于以下问题:PHP HTTPClient::getHTTPClient方法的具体用法?PHP HTTPClient::getHTTPClient怎么用?PHP HTTPClient::getHTTPClient使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HTTPClient
的用法示例。
在下文中一共展示了HTTPClient::getHTTPClient方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: OpenIDConsumer
function OpenIDConsumer($http_client = null, $assoc_mngr = null)
{
$this->http_client = $http_client ? $http_client : HTTPClient::getHTTPClient();
$this->assoc_mngr = $assoc_mngr ? $assoc_mngr : new DumbAssociationManager();
}
示例2: parse_str
parse_str($parts['query'], $this->query);
$response = $this->consumer->check_auth($su, $rt, $pd);
$response->doAction($this);
} else {
$this->_headers();
echo $this->_inputForm();
}
}
}
}
}
if (strstr($_SERVER['REQUEST_URI'], 'httpconsumer.php')) {
// flags used to control consumer behavior.
$dumb = false;
$split = false;
$http_client = HTTPClient::getHTTPClient();
$assoc_mngr = null;
$consumer = null;
if ($dumb) {
$assoc_mngr = new DumbAssociationManager($http_client);
} else {
$assoc_mngr = new DictionaryAssociationManager($http_client);
}
$consumer = new SampleConsumer($http_client, $assoc_mngr);
// print 'Consumer Server running...'
$handler = new ConsumerHandler($consumer, $_SERVER['SCRIPT_URI'], $split, $dumb);
$handler->do_GET();
}
?>