Exemple #1
0
 /**
  * @param array $oauth_parms - associative arrays with oauth_ parameters
  * @param array $oauth_urls - associative array with keys: request, authorize, access, revoke (with corresponding url's as values)
  */
 public function __construct($oauth_parms = null, $oauth_urls = null)
 {
     parent::__construct();
     $this->reset_oauth_parms();
     $this->set_oauth_parms($oauth_parms, $oauth_urls);
     $this->CURLOPT_USERAGENT = "Svetlozar.NET.OAuthClient.PHP/2010.02";
     $this->__encoding_callback = SPUtils::encode_function3986();
 }
Exemple #2
0
 /**
  * Constructor will either restore authenticated state (setting authenticated to true if auth token is given) or initialize the login parms to empty
  * Do not call the constructor with login parameters, use Authenticate() instead
  * @param string $authstate - optional, if provided it should be from GetState when authenticated is true
  */
 public function __construct()
 {
     $authstate = func_get_args();
     if ($authstate && is_array(current($authstate))) {
         $authstate = array_shift($authstate);
     }
     if ($authstate) {
         $this->RestoreState($authstate);
     }
     if (!$this->Authenticated()) {
         $this->Reset();
         $this->SetSource(isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : "Unknown");
     }
     parent::__construct();
 }
Exemple #3
0
 /**
  * Initialize cookies and curl options (if provided, both are optional)
  * @param $cookies
  * @param $curlopts
  */
 function __construct($cookies = null, $curlopts = null)
 {
     $this->reset_cookies_state($cookies);
     parent::__construct($curlopts);
 }