/** * Constructs an OAuth 2.0 service provider. * * @param array $options An array of options to set on this provider. * Options include `clientId`, `clientSecret`, `redirectUri`, and `state`. * Individual providers may introduce more options, as needed. * @param array $collaborators An array of collaborators that may be used to * override this provider's default behavior. Collaborators include * `grantFactory`, `requestFactory`, `httpClient`, and `randomFactory`. * Individual providers may introduce more collaborators, as needed. */ public function __construct(array $options = [], array $collaborators = []) { parent::__construct($options, $collaborators); if ($this->token) { $this->token = new ModulbankAccessToken(['accessToken' => $this->token]); } }
public function __construct($options = []) { if (empty($options['domainPrefix'])) { throw new \RuntimeException('Vend provider requires a "domainPrefix" option'); } parent::__construct($options); }
/** * Provider constructor. * @param array $options */ public function __construct(array $options = array()) { parent::__construct($options); if (isset($options['sandbox']) && $options['sandbox']) { $this->baseURL = 'https://api.sandbox.freeagent.com/v2/'; } }
public function __construct() { parent::__construct(['clientId' => Mage::getStoreConfig('octahedron_pos/connection/client_id'), 'clientSecret' => Mage::getStoreConfig('octahedron_pos/connection/client_secret')]); $this->url = 'https://' . Mage::getStoreConfig('octahedron_pos/connection/url'); $this->headers['Accept'] = 'application/json'; $this->cache = Mage::app()->getCache(); }
/** * @param array $options * @param array $collaborators */ public function __construct($options = [], array $collaborators = []) { parent::__construct($options); if (isset($options['devMode'])) { $this->setDevMode($options['devMode']); } }
/** * Gitlab constructor. * * @param array $options * @param array $collaborators */ public function __construct(array $options, array $collaborators = []) { if (isset($options['domain'])) { $this->domain = $options['domain']; } parent::__construct($options, $collaborators); }
public function __construct($options = []) { parent::__construct($options); if (isset($options['testMode'])) { $this->testMode = $options['testMode']; } }
/** * Constructs an OAuth 2.0 service provider. * * @param array $options An array of options to set on this provider. * Options include `clientId`, `clientSecret`, `redirectUri`, and `state`. * Individual providers may introduce more options, as needed. * @param array $collaborators An array of collaborators that may be used to * override this provider's default behavior. Collaborators include * `grantFactory`, `requestFactory`, `httpClient`, and `randomFactory`. * Individual providers may introduce more collaborators, as needed. */ public function __construct(array $options = [], array $collaborators = []) { parent::__construct($options, $collaborators); if (empty($this->subdomain)) { throw new Exception\ProviderConfigurationException('No subdomain has been configured for this Zendesk provider; it has to have a subdomain.'); } }
public function __construct($options = []) { if (!array_has($options, 'redirectUri')) { $options['redirectUri'] = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING']; } parent::__construct($options); }
/** * Constructs an OAuth 2.0 service provider. * * Override to add UserFactory * * @param array $options An array of options to set on this provider. * Options include `clientId`, `clientSecret`, `redirectUri`, and `state`. * Individual providers may introduce more options, as needed. * @param array $collaborators An array of collaborators that may be used to * override this provider's default behavior. Collaborators include * `grantFactory`, `requestFactory`, `httpClient`, and `randomFactory`. * Individual providers may introduce more collaborators, as needed. */ public function __construct(array $options = [], array $collaborators = []) { parent::__construct($options, $collaborators); if (empty($collaborators['userFactory'])) { $collaborators['userFactory'] = new UserFactory(); } $this->setUserFactory($collaborators['userFactory']); }
/** * Constructs an OAuth 2.0 service provider. * * @param array $options An array of options to set on this provider. * Options include `clientId`, `clientSecret`, `redirectUri`, and `state`. * Individual providers may introduce more options, as needed. * @param array $collaborators An array of collaborators that may be used to * override this provider's default behavior. Collaborators include * `grantFactory`, `requestFactory`, `httpClient`, and `randomFactory`. * Individual providers may introduce more collaborators, as needed. */ public function __construct(array $options = [], array $collaborators = []) { if (isset($options['encryptionKeyPath'])) { $this->setEncryptionKeyPath($options['encryptionKeyPath']); unset($options['encryptionKeyPath']); } parent::__construct($options, $collaborators); }
/** * {@inheritdoc} */ public function __construct(array $options = [], array $collaborators = []) { if (!empty($options['domain'])) { $this->domain = $options['domain']; // for custom environments } parent::__construct($options, $collaborators); }
public function __construct($options = array()) { if (empty($options['rootUrl'])) { throw new UnexpectedValueException('Missing rootUrl configuration'); } parent::__construct($options); $this->_domain = rtrim($options['rootUrl'], '/'); }
public function __construct(array $options = [], array $collaborators = []) { parent::__construct($options, $collaborators); if (!isset($options['account'])) { throw new HumanClientException('Account must be supllied'); } $this->changeDomainUrl($options['account']); }
public function __construct($options = []) { parent::__construct($options); if (empty($options['graphApiVersion'])) { $message = 'The "graphApiVersion" option not set. Please set a default Graph API version.'; throw new \InvalidArgumentException($message); } $this->graphApiVersion = $options['graphApiVersion']; }
/** * @param array $options * @param array $collaborators * * @throws \InvalidArgumentException */ public function __construct($options = [], array $collaborators = []) { parent::__construct($options, $collaborators); if (empty($options['storeName'])) { $message = 'The "storeName" option not set. Please set Store Name.'; throw new \InvalidArgumentException($message); } $this->storeName = $options['storeName']; }
public function __construct($options = array()) { parent::__construct($options); if (isset($options['dhis2ServerUri'])) { $this->dhis2ServerUri = $options['dhis2ServerUri']; } else { throw new \Exception("dhis2ServerUri not set. This is the DHIS Server URL", 1); } }
/** * Constructs an OAuth 2.0 service provider. * * @param array $options An array of options to set on this provider. * Options include `clientId`, `clientSecret`, `redirectUri`, `state`, `apiVersion`. * Individual providers may introduce more options, as needed. * @param array $collaborators An array of collaborators that may be used to * override this provider's default behavior. Collaborators include * `grantFactory`, `requestFactory`, `httpClient`, and `randomFactory`. * Individual providers may introduce more collaborators, as needed. */ public function __construct(array $options = [], array $collaborators = []) { parent::__construct($options, $collaborators); foreach ($options as $option => $value) { if (property_exists($this, $option)) { $this->{$option} = $value; } } }
public function __construct(array $options = [], array $collaborators = [], $mode = null) { $this->assertRequiredOptions($options); foreach ($options as $key => $value) { $this->{$key} = $value; } $this->mode = $mode; parent::__construct($options, $collaborators); }
public function __construct($options = []) { if (!empty($options['marketPrefix'])) { // Ensure that the market domain prefix always starts with a dot if ($options['marketPrefix'][0] !== '.') { $options['marketPrefix'] = '.' . $options['marketPrefix']; } } parent::__construct($options); }
/** * @param array $options * @param array $collaborators * * @throws \InvalidArgumentException */ public function __construct($options = [], array $collaborators = []) { parent::__construct($options, $collaborators); if (empty($options['graphApiVersion'])) { $message = 'The "graphApiVersion" option not set. Please set a default Graph API version.'; throw new \InvalidArgumentException($message); } $this->graphApiVersion = $options['graphApiVersion']; if (!empty($options['enableBetaTier']) && $options['enableBetaTier'] === true) { $this->enableBetaMode = true; } }
/** * @param array $options * @param array $collaborators */ public function __construct(array $options = [], array $collaborators = []) { $possible = $this->getConfigurableOptions(); $configured = array_intersect_key($options, array_flip($possible)); foreach ($configured as $key => $value) { $this->{$key} = $value; } // Remove all options that are only used locally $options = array_diff_key($options, $configured); parent::__construct($options, $collaborators); $this->setHttpClient(new Client(array_intersect_key($options, array_flip(['verify', 'timeout'])))); }
public function __construct($options = [], array $collaborators = []) { $this->assertRequiredOptions($options); $possible = $this->getConfigurableOptions(); $configured = array_intersect_key($options, array_flip($possible)); foreach ($configured as $key => $value) { $this->{$key} = $value; } // Remove all options that are only used locally $options = array_diff_key($options, $configured); return parent::__construct($options, $collaborators); }
/** * @param array $options * @param array $collaborators * * @throws \InvalidArgumentException */ public function __construct($options = [], array $collaborators = []) { parent::__construct($options, $collaborators); if (empty($options['graphApiVersion'])) { $message = 'The "graphApiVersion" option not set. Please set a default Graph API version.'; throw new \InvalidArgumentException($message); } elseif (!preg_match(self::GRAPH_API_VERSION_REGEX, $options['graphApiVersion'])) { $message = 'The "graphApiVersion" must start with letter "v" followed by version number, ie: "v2.4".'; throw new \InvalidArgumentException($message); } $this->graphApiVersion = $options['graphApiVersion']; if (!empty($options['enableBetaTier']) && $options['enableBetaTier'] === true) { $this->enableBetaMode = true; } }
public function __construct(array $options = [], array $collaborators = []) { parent::__construct($options, $collaborators); // We need to validate some data to make sure we haven't constructed in an illegal state. if (!in_array($this->game, ["sc2", "wow"])) { throw new \InvalidArgumentException("Game must be either sc2 or wow, given: {$this->game}"); } $availableRegions = ["us", "eu", "kr", "tw", "cn", "sea"]; if (!in_array($this->region, $availableRegions)) { $regionList = implode(", ", $availableRegions); throw new \InvalidArgumentException("Region must be one of: {$regionList}, given: {$this->region}"); } if ($this->region == "sea" && $this->game != "sc2") { throw new \InvalidArgumentException("sea region is only available for sc2"); } }
public function __construct($options = array()) { $host = parse_url($options['SPSiteUrl'], PHP_URL_HOST); // Validate that parse_url at least could parse the SPSiteUrl parameter if (!$host) { throw new DomainException('The SPSiteUrl parameter' . ' is not a valid URI'); } $this->spsite = $options['SPSiteUrl']; // The JWT token is base 64 coded. // Decoding it gives us a string in JSON format. $json = base64_decode($options['SPAppToken']); // Remove the JWT header $start = strpos($json, '{"typ":"JWT","alg":"HS256"}') + 27; // And get the body of the token $length = strrpos($json, '"}') + 2 - $start; $json = substr($json, $start, $length); // Get a JSON object from the string and and extract the appCtx $jsonObj = json_decode($json); if ($jsonObj === null) { throw new DomainException('The SPAppToken parameter is ' . ' not a base64 JSON string'); } $appCtx = json_decode($jsonObj->appctx); // The appCtxSender contains values that we need to // construct parameters that we send to the token service $appCtxSender = explode("@", $jsonObj->appctxsender); $this->resource = $appCtxSender[0] . '/' . $host . '@' . $appCtxSender[1]; $clientId = $options['clientId'] . '@' . $appCtxSender[1]; // Extract the refresh token from the JSON object. $this->refreshToken = $jsonObj->refreshtoken; // Get the token service URI from the JSON object. $this->tokenServiceUri = $appCtx->SecurityTokenServiceUri; if (array_key_exists('tenantId', $options)) { $this->tenantId = $options['tenantId']; unset($options['tenantId']); } $options['clientId'] = $clientId; $options['resource'] = $this->resource; parent::__construct($options); }
public function __construct($options) { parent::__construct($options); $this->headers = ['Accept' => 'application/json']; }
/** * Constructor for the Abstract FitBit class. The constructor will set the * request URIs that the application will interact with, so that the * implementor doesn't need to specify URLs on request. * @param array $options An array of options to set on this provider. * Options include `clientId`, `clientSecret`, `redirectUri`, and `state`. * Individual providers may introduce more options, as needed. * @param array $collaborators An array of collaborators that may be used to * override this provider's default behavior. Collaborators include * `grantFactory`, `requestFactory`, `httpClient`, and `randomFactory`. * Individual providers may introduce more collaborators, as needed. */ public function __construct(array $options = [], array $collaborators = []) { $options = array_merge($options, array('urlApiBase' => 'https://api.fitbit.com/1/', 'urlAuthorize' => 'https://www.fitbit.com/oauth2/authorize', 'urlAccessToken' => 'https://api.fitbit.com/oauth2/token', 'urlResourceOwnerDetails' => 'https://api.fitbit.com/1/users/-/profile.json')); parent::__construct($options, $collaborators); }
public function __construct($options = []) { $options['scopeSeparator'] = ' '; parent::__construct($options); }
public function __construct($options) { parent::__construct($options); $this->headers = array('Authorization' => 'Bearer'); }