Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

… things go south.
  • Loading branch information...
commit 6d02e84cbf1e273197335605bfaa9526b307c94d 1 parent 5a9fb3b
Zach Graves zachgraves authored
12 lib/Yahoo/YahooOAuthAccessToken.class.php
@@ -54,9 +54,10 @@ class YahooOAuthAccessToken extends OAuthToken
54 54 $expires_in = null,
55 55 $session_handle = null,
56 56 $authorization_expires_in = null,
57   - $yahoo_guid = null;
  57 + $yahoo_guid = null,
  58 + $oauth_problem = null;
58 59
59   - public function __construct($key, $secret, $expires_in=null, $session_handle=null, $authorization_expires_in=null, $yahoo_guid=null)
  60 + public function __construct($key, $secret, $expires_in=null, $session_handle=null, $authorization_expires_in=null, $yahoo_guid=null, $oauth_problem=null)
60 61 {
61 62 $this->key = $key;
62 63 $this->secret = $secret;
@@ -64,6 +65,7 @@ public function __construct($key, $secret, $expires_in=null, $session_handle=nul
64 65 $this->session_handle = $session_handle;
65 66 $this->authorization_expires_in = $authorization_expires_in;
66 67 $this->yahoo_guid = $yahoo_guid;
  68 + $this->oauth_problem = $oauth_problem;
67 69 }
68 70
69 71 public function to_string()
@@ -73,7 +75,8 @@ public function to_string()
73 75 'oauth_expires_in' => $this->expires_in,
74 76 'oauth_session_handle' => $this->session_handle,
75 77 'oauth_authorization_expires_in' => $this->authorization_expires_in,
76   - 'xoauth_yahoo_guid' => $this->yahoo_guid
  78 + 'xoauth_yahoo_guid' => $this->yahoo_guid,
  79 + 'oauth_problem' => $this->oauth_problem
77 80 ));
78 81 }
79 82
@@ -90,8 +93,9 @@ public static function from_string($token)
90 93 $session_handle = isset($params['oauth_session_handle']) ? $params['oauth_session_handle'] : null;
91 94 $authorization_expires_in = isset($params['oauth_authorization_expires_in']) ? $params['oauth_authorization_expires_in'] : null;
92 95 $yahoo_guid = isset($params['xoauth_yahoo_guid']) ? $params['xoauth_yahoo_guid'] : null;
  96 + $oauth_problem = isset($params['oauth_problem']) ? $params['oauth_problem'] : null;
93 97
94   - return new self($key, $secret, $expires_in, $session_handle, $authorization_expires_in, $yahoo_guid);
  98 + return new self($key, $secret, $expires_in, $session_handle, $authorization_expires_in, $yahoo_guid, $oauth_problem);
95 99 }
96 100
97 101 }
12 lib/Yahoo/YahooOAuthRequestToken.class.php
@@ -49,14 +49,16 @@ class YahooOAuthRequestToken extends OAuthToken
49 49 public $key = null,
50 50 $secret = null,
51 51 $expires_in = null,
52   - $request_auth_url = null;
  52 + $request_auth_url = null,
  53 + $oauth_problem = null;
53 54
54   - public function __construct($key, $secret, $expires_in=null, $request_auth_url=null)
  55 + public function __construct($key, $secret, $expires_in=null, $request_auth_url=null, $oauth_problem=null)
55 56 {
56 57 $this->key = $key;
57 58 $this->secret = $secret;
58 59 $this->expires_in = $expires_in;
59 60 $this->request_auth_url = $request_auth_url;
  61 + $this->oauth_problem = $oauth_problem;
60 62 }
61 63
62 64 public function to_string()
@@ -64,7 +66,8 @@ public function to_string()
64 66 return http_build_query(array('oauth_token' => $this->key,
65 67 'oauth_token_secret' => $this->secret,
66 68 'oauth_expires_in' => $this->expires_in,
67   - 'xoauth_request_auth_url' => $this->request_auth_url
  69 + 'xoauth_request_auth_url' => $this->request_auth_url,
  70 + 'oauth_problem' => $this->oauth_problem
68 71 ));
69 72 }
70 73
@@ -79,7 +82,8 @@ public static function from_string($token)
79 82 $secret = isset($params['oauth_token_secret']) ? $params['oauth_token_secret'] : null;
80 83 $expires_in = isset($params['oauth_expires_in']) ? $params['oauth_expires_in'] : null;
81 84 $request_auth_url = isset($params['xoauth_request_auth_url']) ? $params['xoauth_request_auth_url'] : null;
  85 + $oauth_problem = isset($params['oauth_problem']) ? $params['oauth_problem'] : null;
82 86
83   - return new self($key, $secret, $expires_in, $request_auth_url);
  87 + return new self($key, $secret, $expires_in, $request_auth_url, $oauth_problem);
84 88 }
85 89 }

0 comments on commit 6d02e84

Please sign in to comment.
Something went wrong with that request. Please try again.