You are here

public function OAuthStoreSession::__construct in Lingotek Translation 7.5

Same name and namespace in other branches
  1. 7.7 lib/oauth-php/library/store/OAuthStoreSession.php \OAuthStoreSession::__construct()
  2. 7.2 lib/oauth-php/library/store/OAuthStoreSession.php \OAuthStoreSession::__construct()
  3. 7.3 lib/oauth-php/library/store/OAuthStoreSession.php \OAuthStoreSession::__construct()
  4. 7.4 lib/oauth-php/library/store/OAuthStoreSession.php \OAuthStoreSession::__construct()
  5. 7.6 lib/oauth-php/library/store/OAuthStoreSession.php \OAuthStoreSession::__construct()

File

lib/oauth-php/library/store/OAuthStoreSession.php, line 43

Class

OAuthStoreSession

Code

public function __construct($options = array()) {
  if (!session_id()) {
    session_start();
  }
  if (isset($options['consumer_key']) && isset($options['consumer_secret'])) {
    $this->session =& $_SESSION['oauth_' . $options['consumer_key']];
    $this->session['consumer_key'] = $options['consumer_key'];
    $this->session['consumer_secret'] = $options['consumer_secret'];
    $this->session['signature_methods'] = array(
      'HMAC-SHA1',
    );
    $this->session['server_uri'] = $options['server_uri'];
    $this->session['request_token_uri'] = $options['request_token_uri'];
    $this->session['authorize_uri'] = $options['authorize_uri'];
    $this->session['access_token_uri'] = $options['access_token_uri'];
  }
  else {
    throw new OAuthException2("OAuthStoreSession needs consumer_token and consumer_secret");
  }
}