krz/vox-populi
A Tumblr web client.
clone: git clone https://gitbay.org/krz/vox-populi.git
main: vendor/eher/oauth/src/Eher/OAuth/Token.php · raw
1<?php
2
3namespace Eher\OAuth;
4
5class Token {
6 // access tokens and request tokens
7 public $key;
8 public $secret;
9
10 /**
11 * key = the token
12 * secret = the token secret
13 */
14 function __construct($key, $secret) {
15 $this->key = $key;
16 $this->secret = $secret;
17 }
18
19 /**
20 * generates the basic string serialization of a token that a server
21 * would respond to request_token and access_token calls with
22 */
23 function to_string() {
24 return "oauth_token=" .
25 Util::urlencode_rfc3986($this->key) .
26 "&oauth_token_secret=" .
27 Util::urlencode_rfc3986($this->secret);
28 }
29
30 function __toString() {
31 return $this->to_string();
32 }
33}
34