/** * Constructor. * * @param array $config Configuration options. */ public function __construct(array $config = array()) { $defaults = array('scheme' => 'https', 'host' => '{:login}.freshbooks.com', 'port' => null, 'login' => null, 'password' => '', 'auth' => 'Basic', 'version' => '1.1', 'path' => '/api/2.1'); $config += $defaults; $config['host'] = String::insert($config['host'], $config); $config['login'] = $config['password']; $config['password'] = '******'; parent::__construct($config); }
/** * Constructor. * * @param array $config Configuration options. */ public function __construct(array $config = array()) { $defaults = array('adapter' => 'GitHub', 'token' => null, 'scheme' => 'https', 'version' => '1.1', 'host' => 'api.github.com', 'port' => 443, 'path' => '', 'headers' => array('Accept' => 'application/vnd.github.beta+json')); if (!empty($config['token'])) { $defaults['headers'] += array("Authorization" => "token {$config['token']}"); } if (!empty($config['login']) && !empty($config['password'])) { $defaults['auth'] = "Basic"; } parent::__construct($config + $defaults); }
/** * Constructor. * * @param array $config Configuration options. */ public function __construct(array $config = array()) { if (!empty($config['token'])) { $login = $config['login'] . '/token'; $password = $config['token']; } else { $login = $config['login']; $password = $config['password']; } $defaults = array('adapter' => 'GitHub', 'token' => null, 'scheme' => 'https', 'auth' => 'Basic', 'version' => '1.1', 'port' => 443, 'basePath' => '/api/v2/json'); $config['host'] = 'github.com'; $config['login'] = $login; $config['password'] = $password; parent::__construct($config + $defaults); }
/** * Constructor * * @param array $config */ public function __construct(array $config = array()) { $defaults = array('host' => 'api.clickatell.com', 'scheme' => 'https', 'port' => '443', 'method' => 'get', 'service' => 'rest', 'format' => 'xml', 'method_prefix' => 'clickatell', 'encoding' => 'UTF-8', 'socket' => 'Context'); $config += $defaults; if (!isset($config['api_id'])) { throw new ConfigException('Clickatell api_id is not configured.'); } if (!isset($config['api_username'])) { throw new ConfigException('Clickatell api_username is not configured.'); } if (!isset($config['api_password'])) { throw new ConfigException('Clickatell api_password is not configured.'); } parent::__construct($config); }
/** * Constructor. * @param array $config */ public function __construct(array $config = array()) { $defaults = array('port' => 5984, 'version' => 1); parent::__construct($config + $defaults); }
/** * Add configuration to the WordPress data source * * @param array $config The optional config */ public function __construct(array $config = array()) { $config += array('provider' => 'google', 'providerAdapter' => 'curl', 'providerOptions' => array()); parent::__construct($config); }
public function __construct(array $config = array()) { $defaults = array('scheme' => 'http', 'host' => 'otter.topsy.com', 'port' => 80, 'version' => '1.1'); $config += $defaults; parent::__construct($config + $defaults); }
/** * Constructor * * @param array $config * @return void */ public function __construct($config = array()) { $defaults = array('port' => 5984); $config = (array) $config + $defaults; parent::__construct($config); }
public function __construct(array $config = array()) { $defaults = array('host' => 'localhost', 'port' => 8080); parent::__construct($config + $defaults); $this->_queryBuilder = $this->_instance('query'); }