You are here

class OAuthToken in OAuth 1.0 6

Same name and namespace in other branches
  1. 6.3 lib/OAuth.php \OAuthToken
  2. 7.3 lib/OAuth.php \OAuthToken

Hierarchy

Expanded class hierarchy of OAuthToken

File

./OAuth.php, line 21

View source
class OAuthToken {

  /*{{{*/

  // access tokens and request tokens
  public $key;
  public $secret;

  /**
   * key = the token
   * secret = the token secret
   */
  function __construct($key, $secret) {

    /*{{{*/
    $this->key = $key;
    $this->secret = $secret;
  }

  /*}}}*/

  /**
   * generates the basic string serialization of a token that a server
   * would respond to request_token and access_token calls with
   */
  function to_string() {

    /*{{{*/
    return "oauth_token=" . OAuthUtil::urlencodeRFC3986($this->key) . "&oauth_token_secret=" . OAuthUtil::urlencodeRFC3986($this->secret);
  }

  /*}}}*/
  function __toString() {

    /*{{{*/
    return $this
      ->to_string();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
OAuthToken::$key public property
OAuthToken::$secret public property
OAuthToken::to_string function generates the basic string serialization of a token that a server would respond to request_token and access_token calls with
OAuthToken::__construct function key = the token secret = the token secret
OAuthToken::__toString function