Esempio n. 1
0
 /**
  * @param string $host
  * @param string $token
  * @param Client $client
  */
 public function __construct($host, $token = null, Client $client = null)
 {
     $this->client = $client ?: new Client($host);
     if ($token) {
         $this->client->authenticate($token, Client::AUTH_URL_TOKEN);
     }
     parent::__construct();
 }
Esempio n. 2
0
 /**
  * @param string $token
  * @param Client $client
  */
 public function __construct($token = null, Client $client = null)
 {
     $this->client = $client ?: new Client(new CachedHttpClient());
     if ($token) {
         $this->client->authenticate($token, null, Client::AUTH_HTTP_PASSWORD);
     }
     parent::__construct();
 }
Esempio n. 3
0
 /**
  * @param string $username
  * @param string $password
  */
 public function __construct($username = null, $password = null, Api $api = null)
 {
     $this->api = $api ?: new Api();
     if ($username && $password) {
         $this->api->setCredentials(new Basic($username, $password));
     }
     parent::__construct();
 }