aboutsummaryrefslogtreecommitdiffstats
path: root/library/twitteroauth.php
diff options
context:
space:
mode:
authorredmatrix <redmatrix@redmatrix.me>2015-12-13 15:35:45 -0800
committerredmatrix <redmatrix@redmatrix.me>2015-12-13 15:35:45 -0800
commitbb0e4044bf08bbac9d73a3e3b75d74c33dcacd7f (patch)
tree1c6292b26b08bb86ef36cc258cd617197f5844a8 /library/twitteroauth.php
parent395268da22bf5ec773de7fdc42a338a9cbe87d40 (diff)
downloadvolse-hubzilla-bb0e4044bf08bbac9d73a3e3b75d74c33dcacd7f.tar.gz
volse-hubzilla-bb0e4044bf08bbac9d73a3e3b75d74c33dcacd7f.tar.bz2
volse-hubzilla-bb0e4044bf08bbac9d73a3e3b75d74c33dcacd7f.zip
remove the unqualified "OAuth" namespace from the project. We need to reference either OAuth1 or OAuth2.
Diffstat (limited to 'library/twitteroauth.php')
-rw-r--r--library/twitteroauth.php24
1 files changed, 12 insertions, 12 deletions
diff --git a/library/twitteroauth.php b/library/twitteroauth.php
index a40949534..d6fb1b3a2 100644
--- a/library/twitteroauth.php
+++ b/library/twitteroauth.php
@@ -6,8 +6,8 @@
* The first PHP Library to support OAuth for Twitter's REST API.
*/
-/* Load OAuth lib. You can find it at http://oauth.net */
-if(!class_exists('OAuthException'))
+/* Load OAuth1 lib. You can find it at http://oauth.net */
+if(!class_exists('OAuth1Exception'))
require_once('library/OAuth1.php');
/**
@@ -58,10 +58,10 @@ class TwitterOAuth {
* construct TwitterOAuth object
*/
function __construct($consumer_key, $consumer_secret, $oauth_token = NULL, $oauth_token_secret = NULL) {
- $this->sha1_method = new OAuthSignatureMethod_HMAC_SHA1();
- $this->consumer = new OAuthConsumer($consumer_key, $consumer_secret);
+ $this->sha1_method = new OAuth1SignatureMethod_HMAC_SHA1();
+ $this->consumer = new OAuth1Consumer($consumer_key, $consumer_secret);
if (!empty($oauth_token) && !empty($oauth_token_secret)) {
- $this->token = new OAuthConsumer($oauth_token, $oauth_token_secret);
+ $this->token = new OAuth1Consumer($oauth_token, $oauth_token_secret);
} else {
$this->token = NULL;
}
@@ -79,8 +79,8 @@ class TwitterOAuth {
$parameters['oauth_callback'] = $oauth_callback;
}
$request = $this->oAuthRequest($this->requestTokenURL(), 'GET', $parameters);
- $token = OAuthUtil::parse_parameters($request);
- $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
+ $token = OAuth1Util::parse_parameters($request);
+ $this->token = new OAuth1Consumer($token['oauth_token'], $token['oauth_token_secret']);
return $token;
}
@@ -115,8 +115,8 @@ class TwitterOAuth {
$parameters['oauth_verifier'] = $oauth_verifier;
}
$request = $this->oAuthRequest($this->accessTokenURL(), 'GET', $parameters);
- $token = OAuthUtil::parse_parameters($request);
- $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
+ $token = OAuth1Util::parse_parameters($request);
+ $this->token = new OAuth1Consumer($token['oauth_token'], $token['oauth_token_secret']);
return $token;
}
@@ -135,8 +135,8 @@ class TwitterOAuth {
$parameters['x_auth_password'] = $password;
$parameters['x_auth_mode'] = 'client_auth';
$request = $this->oAuthRequest($this->accessTokenURL(), 'POST', $parameters);
- $token = OAuthUtil::parse_parameters($request);
- $this->token = new OAuthConsumer($token['oauth_token'], $token['oauth_token_secret']);
+ $token = OAuth1Util::parse_parameters($request);
+ $this->token = new OAuth1Consumer($token['oauth_token'], $token['oauth_token_secret']);
return $token;
}
@@ -180,7 +180,7 @@ class TwitterOAuth {
if (strrpos($url, 'https://') !== 0 && strrpos($url, 'http://') !== 0) {
$url = "{$this->host}{$url}.{$this->format}";
}
- $request = OAuthRequest::from_consumer_and_token($this->consumer, $this->token, $method, $url, $parameters);
+ $request = OAuth1Request::from_consumer_and_token($this->consumer, $this->token, $method, $url, $parameters);
$request->sign_request($this->sha1_method, $this->consumer, $this->token);
switch ($method) {
case 'GET':