本文整理汇总了PHP中HttpClient::useIdentity方法的典型用法代码示例。如果您正苦于以下问题:PHP HttpClient::useIdentity方法的具体用法?PHP HttpClient::useIdentity怎么用?PHP HttpClient::useIdentity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpClient
的用法示例。
在下文中一共展示了HttpClient::useIdentity方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: linkData
protected function linkData()
{
// use credential to access SPARQL server, if required
if ($this->username) {
HttpClient::useIdentity($this->username, $this->password);
}
if (!empty($this->endpoint) && !empty($this->constructor)) {
// create links to data
$sparql = new SparqlClient($this->endpoint);
$endpointQuery = $this->templateEngine->setTemplate($this->constructor . ' LIMIT {limit} OFFSET {offset}')->render();
$this->resultGraph = $sparql->query($endpointQuery);
// add queryResource to template vars
$this->templateEngine->addVar('queryResource', $this->endpoint . '?query=' . urlencode($endpointQuery));
// calculate if hasNextPage according pagingPolicy
$this->hasNextPage = $this->pagingPolicy == self::AGGRESSIVE ? $this->resultGraph->countTriples() == $this->context->getPageSize() : !$this->resultGraph->isEmpty();
}
return $this;
}