summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/openid/lib/Auth/Yadis/Yadis.php')
-rw-r--r--plugins/openid/lib/Auth/Yadis/Yadis.php41
1 files changed, 26 insertions, 15 deletions
diff --git a/plugins/openid/lib/Auth/Yadis/Yadis.php b/plugins/openid/lib/Auth/Yadis/Yadis.php
index 5be56da1..70dc944d 100644
--- a/plugins/openid/lib/Auth/Yadis/Yadis.php
+++ b/plugins/openid/lib/Auth/Yadis/Yadis.php
@@ -48,25 +48,28 @@ define('Auth_Yadis_HEADER_NAME', 'X-XRDS-Location');
class Auth_Yadis_DiscoveryResult {
// The URI that was passed to the fetcher
- var $request_uri = null;
+ public $request_uri = null;
// The result of following redirects from the request_uri
- var $normalized_uri = null;
+ public $normalized_uri = null;
// The URI from which the response text was returned (set to
// None if there was no XRDS document found)
- var $xrds_uri = null;
+ public $xrds_uri = null;
- var $xrds = null;
+ /**
+ * @var Auth_Yadis_XRDS
+ */
+ public $xrds = null;
// The content-type returned with the response_text
- var $content_type = null;
+ public $content_type = null;
// The document returned from the xrds_uri
- var $response_text = null;
+ public $response_text = null;
// Did the discovery fail miserably?
- var $failed = false;
+ public $failed = false;
function __construct($request_uri)
{
@@ -123,7 +126,11 @@ class Auth_Yadis_DiscoveryResult {
*
* input_url: The URL on which to perform the Yadis protocol
*
- * @return: The normalized identity URL and an iterable of endpoint
+ * @param string $input_url
+ * @param $xrds_parse_func
+ * @param null $discover_func
+ * @param null $fetcher
+ * @return string The normalized identity URL and an iterable of endpoint
* objects generated by the filter function.
*
* xrds_parse_func: a callback which will take (uri, xrds_text) and
@@ -137,7 +144,7 @@ function Auth_Yadis_getServiceEndpoints($input_url, $xrds_parse_func,
$discover_func=null, $fetcher=null)
{
if ($discover_func === null) {
- $discover_function = array('Auth_Yadis_Yadis', 'discover');
+ $discover_func = array('Auth_Yadis_Yadis', 'discover');
}
$yadis_result = call_user_func_array($discover_func,
@@ -249,6 +256,9 @@ class Auth_Yadis_Yadis {
*
* If Auth_Yadis_CURL_OVERRIDE is defined, this method will always
* return a {@link Auth_Yadis_PlainHTTPFetcher}.
+ *
+ * @param int $timeout
+ * @return Auth_Yadis_ParanoidHTTPFetcher|Auth_Yadis_PlainHTTPFetcher
*/
static function getHTTPFetcher($timeout = 20)
{
@@ -268,6 +278,9 @@ class Auth_Yadis_Yadis {
/**
* @access private
+ * @param array $header_list
+ * @param array $names
+ * @return string
*/
static function _getHeader($header_list, $names)
{
@@ -284,6 +297,8 @@ class Auth_Yadis_Yadis {
/**
* @access private
+ * @param string $content_type_header
+ * @return string
*/
static function _getContentType($content_type_header)
{
@@ -291,6 +306,7 @@ class Auth_Yadis_Yadis {
$parts = explode(";", $content_type_header);
return strtolower($parts[0]);
}
+ return '';
}
/**
@@ -300,16 +316,12 @@ class Auth_Yadis_Yadis {
*
* @param string $uri The URI on which to perform Yadis discovery.
*
- * @param array $http_response An array reference where the HTTP
- * response object will be stored (see {@link
- * Auth_Yadis_HTTPResponse}.
- *
* @param Auth_Yadis_HTTPFetcher $fetcher An instance of a
* Auth_Yadis_HTTPFetcher subclass.
*
* @param array $extra_ns_map An array which maps namespace names
* to namespace URIs to be used when parsing the Yadis XRDS
- * document.
+ * document. UNUSED.
*
* @param integer $timeout An optional fetcher timeout, in seconds.
*
@@ -322,7 +334,6 @@ class Auth_Yadis_Yadis {
{
$result = new Auth_Yadis_DiscoveryResult($uri);
- $request_uri = $uri;
$headers = array("Accept: " . Auth_Yadis_CONTENT_TYPE .
', text/html; q=0.3, application/xhtml+xml; q=0.5');