Esempio n. 1
0
 /**
  * Constructs a Client object. Note that because of the refresh token these are character-specific.
  *
  * @param string $rootEndpointUrl the URL to the CREST root
  * @param string $clientId the Id of the app you registered
  * @param string $clientSecret the secret for the app you registered
  * @param string $charRefreshToken the chracter-specific refresh token to be used
  * @param string $clientUserAgent the user agent that should be used in the requests
  */
 public function __construct($rootEndpointUrl = null, $clientId = null, $clientSecret = null, $charRefreshToken = null, $clientUserAgent = null)
 {
     $this->rootEndpointUrl = is_null($rootEndpointUrl) ? Config::getAuthedCrestBaseUrl() : $rootEndpointUrl;
     $this->clientId = is_null($clientId) ? Config::getCrestClientId() : $clientId;
     $this->clientSecret = is_null($clientSecret) ? Config::getCrestClientSecret() : $clientSecret;
     $this->charRefreshToken = is_null($charRefreshToken) ? Config::getCrestClientRefreshToken() : $charRefreshToken;
     $cacheClass = Config::getIveeClassName('Cache');
     $this->cache = $cacheClass::instance();
     $cwClass = Config::getIveeClassName('CurlWrapper');
     $this->cw = new $cwClass($this->cache, is_null($clientUserAgent) ? Config::getUserAgent() : $clientUserAgent, $this->charRefreshToken);
     //load root endpoint
     $this->rootEndpoint = $this->getEndpoint($this->rootEndpointUrl, false, static::ROOT_REPRESENTATION);
 }
Esempio n. 2
0
 protected function setUp()
 {
     $this->client = new Client(Config::getAuthedCrestBaseUrl(), Config::getCrestClientId(), Config::getCrestClientSecret(), Config::getCrestClientRefreshToken(), Config::getUserAgent());
     $this->handler = new EndpointHandler($this->client);
 }