Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

added oauth_problem to tokens to allow for better error handling when…

… things go south.
  • Loading branch information...
commit 6d02e84cbf1e273197335605bfaa9526b307c94d 1 parent 5a9fb3b
@zachgraves zachgraves authored
View
12 lib/Yahoo/YahooOAuthAccessToken.class.php
@@ -54,9 +54,10 @@ class YahooOAuthAccessToken extends OAuthToken
$expires_in = null,
$session_handle = null,
$authorization_expires_in = null,
- $yahoo_guid = null;
+ $yahoo_guid = null,
+ $oauth_problem = null;
- public function __construct($key, $secret, $expires_in=null, $session_handle=null, $authorization_expires_in=null, $yahoo_guid=null)
+ public function __construct($key, $secret, $expires_in=null, $session_handle=null, $authorization_expires_in=null, $yahoo_guid=null, $oauth_problem=null)
{
$this->key = $key;
$this->secret = $secret;
@@ -64,6 +65,7 @@ public function __construct($key, $secret, $expires_in=null, $session_handle=nul
$this->session_handle = $session_handle;
$this->authorization_expires_in = $authorization_expires_in;
$this->yahoo_guid = $yahoo_guid;
+ $this->oauth_problem = $oauth_problem;
}
public function to_string()
@@ -73,7 +75,8 @@ public function to_string()
'oauth_expires_in' => $this->expires_in,
'oauth_session_handle' => $this->session_handle,
'oauth_authorization_expires_in' => $this->authorization_expires_in,
- 'xoauth_yahoo_guid' => $this->yahoo_guid
+ 'xoauth_yahoo_guid' => $this->yahoo_guid,
+ 'oauth_problem' => $this->oauth_problem
));
}
@@ -90,8 +93,9 @@ public static function from_string($token)
$session_handle = isset($params['oauth_session_handle']) ? $params['oauth_session_handle'] : null;
$authorization_expires_in = isset($params['oauth_authorization_expires_in']) ? $params['oauth_authorization_expires_in'] : null;
$yahoo_guid = isset($params['xoauth_yahoo_guid']) ? $params['xoauth_yahoo_guid'] : null;
+ $oauth_problem = isset($params['oauth_problem']) ? $params['oauth_problem'] : null;
- return new self($key, $secret, $expires_in, $session_handle, $authorization_expires_in, $yahoo_guid);
+ return new self($key, $secret, $expires_in, $session_handle, $authorization_expires_in, $yahoo_guid, $oauth_problem);
}
}
View
12 lib/Yahoo/YahooOAuthRequestToken.class.php
@@ -49,14 +49,16 @@ class YahooOAuthRequestToken extends OAuthToken
public $key = null,
$secret = null,
$expires_in = null,
- $request_auth_url = null;
+ $request_auth_url = null,
+ $oauth_problem = null;
- public function __construct($key, $secret, $expires_in=null, $request_auth_url=null)
+ public function __construct($key, $secret, $expires_in=null, $request_auth_url=null, $oauth_problem=null)
{
$this->key = $key;
$this->secret = $secret;
$this->expires_in = $expires_in;
$this->request_auth_url = $request_auth_url;
+ $this->oauth_problem = $oauth_problem;
}
public function to_string()
@@ -64,7 +66,8 @@ public function to_string()
return http_build_query(array('oauth_token' => $this->key,
'oauth_token_secret' => $this->secret,
'oauth_expires_in' => $this->expires_in,
- 'xoauth_request_auth_url' => $this->request_auth_url
+ 'xoauth_request_auth_url' => $this->request_auth_url,
+ 'oauth_problem' => $this->oauth_problem
));
}
@@ -79,7 +82,8 @@ public static function from_string($token)
$secret = isset($params['oauth_token_secret']) ? $params['oauth_token_secret'] : null;
$expires_in = isset($params['oauth_expires_in']) ? $params['oauth_expires_in'] : null;
$request_auth_url = isset($params['xoauth_request_auth_url']) ? $params['xoauth_request_auth_url'] : null;
+ $oauth_problem = isset($params['oauth_problem']) ? $params['oauth_problem'] : null;
- return new self($key, $secret, $expires_in, $request_auth_url);
+ return new self($key, $secret, $expires_in, $request_auth_url, $oauth_problem);
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.