ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
Auth_Yadis_ProxyResolver Class Reference

Code for using a proxy XRI resolver. More...

+ Collaboration diagram for Auth_Yadis_ProxyResolver:

Public Member Functions

 Auth_Yadis_ProxyResolver ($fetcher, $proxy_url=null)
 queryURL ($xri, $service_type=null)
 query ($xri, $service_types, $filters=array())

Detailed Description

Code for using a proxy XRI resolver.

Definition at line 10 of file XRIRes.php.

Member Function Documentation

Auth_Yadis_ProxyResolver::Auth_Yadis_ProxyResolver (   $fetcher,
  $proxy_url = null 
)

Definition at line 11 of file XRIRes.php.

References Auth_Yadis_getDefaultProxy().

{
$this->fetcher = $fetcher;
$this->proxy_url = $proxy_url;
if (!$this->proxy_url) {
$this->proxy_url = Auth_Yadis_getDefaultProxy();
}
}

+ Here is the call graph for this function:

Auth_Yadis_ProxyResolver::query (   $xri,
  $service_types,
  $filters = array() 
)

Definition at line 40 of file XRIRes.php.

References Auth_Yadis_getCanonicalID(), Auth_Yadis_XRDS\parseXRDS(), and queryURL().

{
$services = array();
$canonicalID = null;
foreach ($service_types as $service_type) {
$url = $this->queryURL($xri, $service_type);
$response = $this->fetcher->get($url);
if ($response->status != 200 and $response->status != 206) {
continue;
}
$xrds = Auth_Yadis_XRDS::parseXRDS($response->body);
if (!$xrds) {
continue;
}
$canonicalID = Auth_Yadis_getCanonicalID($xri,
$xrds);
if ($canonicalID === false) {
return null;
}
$some_services = $xrds->services($filters);
$services = array_merge($services, $some_services);
// TODO:
// * If we do get hits for multiple service_types, we're
// almost certainly going to have duplicated service
// entries and broken priority ordering.
}
return array($canonicalID, $services);
}

+ Here is the call graph for this function:

Auth_Yadis_ProxyResolver::queryURL (   $xri,
  $service_type = null 
)

Definition at line 20 of file XRIRes.php.

References $query, Auth_Yadis_toURINormal(), and Auth_Yadis_XRIAppendArgs().

Referenced by query().

{
// trim off the xri:// prefix
$qxri = substr(Auth_Yadis_toURINormal($xri), 6);
$hxri = $this->proxy_url . $qxri;
$args = array(
'_xrd_r' => 'application/xrds+xml'
);
if ($service_type) {
$args['_xrd_t'] = $service_type;
} else {
// Don't perform service endpoint selection.
$args['_xrd_r'] .= ';sep=false';
}
return $query;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


The documentation for this class was generated from the following file: