Ejemplo n.º 1
0
 /**
  * Constructor. will automatically try to authenticate
  * the user if the AccessToken object is not set.
  *
  * @param   Consumer    A Consumer object.
  * @param   Request     A Request object.
  * @param   AccessToken A AccessToken object.
  */
 function __construct(Consumer $consumer = NULL, Request $request = NULL, AccessToken $accessToken = NULL)
 {
     parent::__construct($consumer, $request);
     if ($accessToken === NULL) {
         $accessToken = $this->obtainBearerToken();
     }
     $this->setAccessToken($accessToken);
 }
Ejemplo n.º 2
0
 /**
  * Constructor. Will automatically try to authenticate
  * the user if the AccessToken object is not set.
  *
  * @param   Consumer    A Consumer object.
  * @param   Request     A Request object.
  * @param   AccessToken A AccessToken object.
  */
 function __construct(Consumer $consumer = NULL, Request $request = NULL, AccessToken $accessToken = NULL)
 {
     parent::__construct($consumer, $request);
     if ($accessToken === NULL) {
         $accessToken = $this->authorize();
     }
     if ($accessToken instanceof AccessToken) {
         $this->accessToken = $accessToken;
     } else {
         $this->setAccessToken($accessToken['oauth_token'], $accessToken['oauth_token_secret']);
     }
 }