public function OAuthStoreSession::__construct in Lingotek Translation 7.4
Same name and namespace in other branches
- 7.7 lib/oauth-php/library/store/OAuthStoreSession.php \OAuthStoreSession::__construct()
- 7.2 lib/oauth-php/library/store/OAuthStoreSession.php \OAuthStoreSession::__construct()
- 7.3 lib/oauth-php/library/store/OAuthStoreSession.php \OAuthStoreSession::__construct()
- 7.5 lib/oauth-php/library/store/OAuthStoreSession.php \OAuthStoreSession::__construct()
- 7.6 lib/oauth-php/library/store/OAuthStoreSession.php \OAuthStoreSession::__construct()
File
- lib/
oauth-php/ library/ store/ OAuthStoreSession.php, line 43
Class
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");
}
}