ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
XRDS.php File Reference

Go to the source code of this file.

Data Structures

class  Auth_Yadis_Service
 
class  Auth_Yadis_XRDS
 

Namespaces

 OpenID
 This module contains code for dealing with associations between consumers and servers.
 

Functions

 Auth_Yadis_getNSMap ()
 
 Auth_Yadis_array_scramble ($arr)
 private More...
 
 Auth_Yadis_getXRDExpiration ($xrd_element, $default=null)
 

Variables

const SERVICES_YADIS_MATCH_ALL 101
 Require the XPath implementation. More...
 
const SERVICES_YADIS_MATCH_ANY 102
 This match mode means a given service must match ANY filters (at least one) passed to the Auth_Yadis_XRDS::services() call. More...
 
const SERVICES_YADIS_MAX_PRIORITY pow(2, 30)
 The priority value used for service elements with no priority specified. More...
 
const Auth_Yadis_XMLNS_XRD_2_0 'xri://$xrd*($v*2.0)'
 XRD XML namespace. More...
 
const Auth_Yadis_XMLNS_XRDS 'xri://$xrds'
 XRDS XML namespace. More...
 

Function Documentation

◆ Auth_Yadis_array_scramble()

Auth_Yadis_array_scramble (   $arr)

private

Definition at line 58 of file XRDS.php.

References $result.

Referenced by Auth_Yadis_Service\getURIs().

59 {
60  $result = array();
61 
62  while (count($arr)) {
63  $index = array_rand($arr, 1);
64  $result[] = $arr[$index];
65  unset($arr[$index]);
66  }
67 
68  return $result;
69 }
$result
+ Here is the caller graph for this function:

◆ Auth_Yadis_getNSMap()

Auth_Yadis_getNSMap ( )

Definition at line 49 of file XRDS.php.

References Auth_Yadis_XMLNS_XRD_2_0, and Auth_Yadis_XMLNS_XRDS.

Referenced by Auth_Yadis_XRDS\parseXRDS().

50 {
51  return array('xrds' => Auth_Yadis_XMLNS_XRDS,
52  'xrd' => Auth_Yadis_XMLNS_XRD_2_0);
53 }
const Auth_Yadis_XMLNS_XRDS
XRDS XML namespace.
Definition: XRDS.php:47
const Auth_Yadis_XMLNS_XRD_2_0
XRD XML namespace.
Definition: XRDS.php:42
+ Here is the caller graph for this function:

◆ Auth_Yadis_getXRDExpiration()

Auth_Yadis_getXRDExpiration (   $xrd_element,
  $default = null 
)

Definition at line 214 of file XRDS.php.

References $t.

215 {
216  $expires_element = $xrd_element->$parser->evalXPath('/xrd:Expires');
217  if ($expires_element === null) {
218  return $default;
219  } else {
220  $expires_string = $expires_element->text;
221 
222  // Will raise ValueError if the string is not the expected
223  // format
224  $t = strptime($expires_string, "%Y-%m-%dT%H:%M:%SZ");
225 
226  if ($t === false) {
227  return false;
228  }
229 
230  // [int $hour [, int $minute [, int $second [,
231  // int $month [, int $day [, int $year ]]]]]]
232  return mktime($t['tm_hour'], $t['tm_min'], $t['tm_sec'],
233  $t['tm_mon'], $t['tm_day'], $t['tm_year']);
234  }
235 }

Variable Documentation

◆ Auth_Yadis_XMLNS_XRD_2_0

const Auth_Yadis_XMLNS_XRD_2_0 'xri://$xrd*($v*2.0)'

XRD XML namespace.

Definition at line 42 of file XRDS.php.

Referenced by Auth_OpenID_findOPLocalIdentifier(), Auth_Yadis_getNSMap(), and Auth_Yadis_XRDS\parseXRDS().

◆ Auth_Yadis_XMLNS_XRDS

const Auth_Yadis_XMLNS_XRDS 'xri://$xrds'

XRDS XML namespace.

Definition at line 47 of file XRDS.php.

Referenced by Auth_Yadis_getNSMap(), and Auth_Yadis_XRDS\parseXRDS().

◆ SERVICES_YADIS_MATCH_ALL

const SERVICES_YADIS_MATCH_ALL 101

Require the XPath implementation.

This match mode means a given service must match ALL filters passed to the Auth_Yadis_XRDS::services() call.

Definition at line 25 of file XRDS.php.

Referenced by Auth_Yadis_XRDS\services().

◆ SERVICES_YADIS_MATCH_ANY

const SERVICES_YADIS_MATCH_ANY 102

This match mode means a given service must match ANY filters (at least one) passed to the Auth_Yadis_XRDS::services() call.

Definition at line 31 of file XRDS.php.

Referenced by Auth_Yadis_XRDS\services().

◆ SERVICES_YADIS_MAX_PRIORITY

const SERVICES_YADIS_MAX_PRIORITY pow(2, 30)

The priority value used for service elements with no priority specified.

Definition at line 37 of file XRDS.php.

Referenced by Auth_Yadis_XRDS\_parse(), and Auth_Yadis_XRDS\services().