ILIAS  eassessment Revision 61809
 All Data Structures Namespaces Files Functions Variables Groups Pages
Auth_Yadis_Service Class Reference
+ Collaboration diagram for Auth_Yadis_Service:

Public Member Functions

 Auth_Yadis_Service ()
 Creates an empty service object.
 getTypes ()
 Return the URIs in the "Type" elements, if any, of this Service element.
 matchTypes ($type_uris)
 getURIs ()
 Return the URIs in the "URI" elements, if any, of this Service element.
 getPriority ()
 Returns the "priority" attribute value of this <Service> element, if the attribute is present.
 getElements ($name)
 Used to get XML elements from this object's <Service> element.

Detailed Description

Definition at line 83 of file XRDS.php.

Member Function Documentation

Auth_Yadis_Service::Auth_Yadis_Service ( )

Creates an empty service object.

Definition at line 88 of file XRDS.php.

{
$this->element = null;
$this->parser = null;
}
Auth_Yadis_Service::getElements (   $name)

Used to get XML elements from this object's <Service> element.

This is what you should use to get all custom information out of this element. This is used by service filter functions to determine whether a service element contains specific tags, etc. NOTE: this only considers elements which are direct children of the <Service> element for this object.

Parameters
string$nameThe name of the element to look for
Returns
array $list An array of elements with the specified name which are direct children of the <Service> element. The nodes returned by this function can be passed to $this->parser methods (see Auth_Yadis_XMLParser).

Definition at line 201 of file XRDS.php.

References $name.

Referenced by getTypes(), and getURIs().

{
return $this->parser->evalXPath($name, $this->element);
}

+ Here is the caller graph for this function:

Auth_Yadis_Service::getPriority ( )

Returns the "priority" attribute value of this <Service> element, if the attribute is present.

Returns null if not.

Returns
mixed $result Null or integer, depending on whether this Service element has a 'priority' attribute.

Definition at line 175 of file XRDS.php.

{
$attributes = $this->parser->attributes($this->element);
if (array_key_exists('priority', $attributes)) {
return intval($attributes['priority']);
}
return null;
}
Auth_Yadis_Service::getTypes ( )

Return the URIs in the "Type" elements, if any, of this Service element.

Returns
array $type_uris An array of Type URI strings.

Definition at line 100 of file XRDS.php.

References $t, and getElements().

Referenced by matchTypes().

{
$t = array();
foreach ($this->getElements('xrd:Type') as $elem) {
$c = $this->parser->content($elem);
if ($c) {
$t[] = $c;
}
}
return $t;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Auth_Yadis_Service::getURIs ( )

Return the URIs in the "URI" elements, if any, of this Service element.

The URIs are returned sorted in priority order.

Returns
array $uris An array of URI strings.

Definition at line 131 of file XRDS.php.

References Auth_Yadis_array_scramble(), and getElements().

{
$uris = array();
$last = array();
foreach ($this->getElements('xrd:URI') as $elem) {
$uri_string = $this->parser->content($elem);
$attrs = $this->parser->attributes($elem);
if ($attrs &&
array_key_exists('priority', $attrs)) {
$priority = intval($attrs['priority']);
if (!array_key_exists($priority, $uris)) {
$uris[$priority] = array();
}
$uris[$priority][] = $uri_string;
} else {
$last[] = $uri_string;
}
}
$keys = array_keys($uris);
sort($keys);
// Rebuild array of URIs.
$result = array();
foreach ($keys as $k) {
$new_uris = Auth_Yadis_array_scramble($uris[$k]);
$result = array_merge($result, $new_uris);
}
$result = array_merge($result,
return $result;
}

+ Here is the call graph for this function:

Auth_Yadis_Service::matchTypes (   $type_uris)

Definition at line 112 of file XRDS.php.

References getTypes().

{
$result = array();
foreach ($this->getTypes() as $typ) {
if (in_array($typ, $type_uris)) {
$result[] = $typ;
}
}
return $result;
}

+ Here is the call graph for this function:


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