Öffentliche Methoden | |
Auth_Yadis_Service () | |
getTypes () | |
matchTypes ($type_uris) | |
getURIs () | |
getPriority () | |
getElements ($name) |
Definiert in Zeile 83 der Datei XRDS.php.
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.
string | $name The name of the element to look for |
Definiert in Zeile 201 der Datei XRDS.php.
getPriority | ( | ) |
Returns the "priority" attribute value of this <Service> element, if the attribute is present. Returns null if not.
Definiert in Zeile 175 der Datei XRDS.php.
00176 { 00177 $attributes = $this->parser->attributes($this->element); 00178 00179 if (array_key_exists('priority', $attributes)) { 00180 return intval($attributes['priority']); 00181 } 00182 00183 return null; 00184 }
getTypes | ( | ) |
Return the URIs in the "Type" elements, if any, of this Service element.
Definiert in Zeile 100 der Datei XRDS.php.
00101 { 00102 $t = array(); 00103 foreach ($this->getElements('xrd:Type') as $elem) { 00104 $c = $this->parser->content($elem); 00105 if ($c) { 00106 $t[] = $c; 00107 } 00108 } 00109 return $t; 00110 }
getURIs | ( | ) |
Return the URIs in the "URI" elements, if any, of this Service element. The URIs are returned sorted in priority order.
Definiert in Zeile 131 der Datei XRDS.php.
00132 { 00133 $uris = array(); 00134 $last = array(); 00135 00136 foreach ($this->getElements('xrd:URI') as $elem) { 00137 $uri_string = $this->parser->content($elem); 00138 $attrs = $this->parser->attributes($elem); 00139 if ($attrs && 00140 array_key_exists('priority', $attrs)) { 00141 $priority = intval($attrs['priority']); 00142 if (!array_key_exists($priority, $uris)) { 00143 $uris[$priority] = array(); 00144 } 00145 00146 $uris[$priority][] = $uri_string; 00147 } else { 00148 $last[] = $uri_string; 00149 } 00150 } 00151 00152 $keys = array_keys($uris); 00153 sort($keys); 00154 00155 // Rebuild array of URIs. 00156 $result = array(); 00157 foreach ($keys as $k) { 00158 $new_uris = Auth_Yadis_array_scramble($uris[$k]); 00159 $result = array_merge($result, $new_uris); 00160 } 00161 00162 $result = array_merge($result, 00163 Auth_Yadis_array_scramble($last)); 00164 00165 return $result; 00166 }
matchTypes | ( | $ | type_uris | ) |
Copyright © 2003 - 2009 MyOOS [Shopsystem]. All rights reserved. MyOOS [Shopsystem] is Free Software released under the GNU/GPL License. Webmaster: info@r23.de (Impressum) |
|