You are here

function DrupalOAuthConsumer::__construct in OAuth 1.0 7.3

Same name and namespace in other branches
  1. 6.3 includes/DrupalOAuthConsumer.inc \DrupalOAuthConsumer::__construct()
  2. 7.4 includes/DrupalOAuthConsumer.inc \DrupalOAuthConsumer::__construct()

File

includes/DrupalOAuthConsumer.inc, line 17

Class

DrupalOAuthConsumer

Code

function __construct($key, $secret, $params = array()) {

  // Backwards compatibility with 6.x-3.0-beta3
  if (is_string($params)) {
    $callback_url = $params;
    if (func_num_args() > 4) {
      $params = func_get_arg(4);
    }
    else {
      $params = array();
    }
    $params['callback_url'] = $callback_url;
  }
  foreach ($params as $param_key => $value) {
    if (isset($this->{$param_key})) {
      $this->{$param_key} = $value;
    }
  }
  if (!empty($this->created)) {
    $this->provider_consumer = TRUE;
  }
  parent::__construct($key, $secret, $this->callback_url);
}