/** * establish all parameters to another YAWIK instance * these are quite good default-parameter for all REST-Clients * * notice: PHP_AUTH_USER and PHP_AUTH_PW are the basic-authentification parameter, * they are set by setAuth($user, $pw). It will be replaced by oAuth2. * at the client they are with available at the $_SERVER['PHP_AUTH_USER'] and $_SERVER['PHP_AUTH_PW'] again * @param null|string $uri * @param array $config */ public function __construct($uri, array $config) { $this->config = $config; $config = ArrayUtils::merge(array('adapter' => 'Zend\\Http\\Client\\Adapter\\Curl', 'keepalive' => false, 'encodecookies' => false, 'outputstream' => false, 'httpversion' => Request::VERSION_11, 'storeresponse' => false, 'maxredirects' => 2), $config); parent::__construct($uri, $config); $this->setEncType('application/json'); $this->authetificate(); }
public function __construct($uri = nulal, $options = null, $token = null) { if ($uri === null) { $uri = self::URL_API_TELEGRAM; } if ($token !== null) { $this->setToken($token); } parent::__construct($uri, $options); }
/** * Constructor; creates a new HTTP Client instance which itself is * just a typical Zend_HTTP_Client subclass with some OAuth icing to * assist in automating OAuth parameter generation, addition and * cryptographioc signing of requests. * * @param array $oauthOptions * @param string $uri * @param array|\Zend\Config\Config $config * @return void */ public function __construct($oauthOptions, $uri = null, $config = null) { parent::__construct($uri, $config); $this->_config = new Config\StandardConfig(); if ($oauthOptions !== null) { if ($oauthOptions instanceof \Zend\Config\Config) { $oauthOptions = $oauthOptions->toArray(); } $this->_config->setOptions($oauthOptions); } }
/** * Constructor; creates a new HTTP Client instance which itself is * just a typical Zend_HTTP_Client subclass with some OAuth icing to * assist in automating OAuth parameter generation, addition and * cryptographic signing of requests. * * @param array|Traversable $oauthOptions * @param string $uri * @param array|Traversable $options */ public function __construct($oauthOptions, $uri = null, $config = null) { parent::__construct($uri, $config); $this->_config = new Config\StandardConfig(); if ($oauthOptions !== null) { if ($oauthOptions instanceof Traversable) { $oauthOptions = ArrayUtils::iteratorToArray($oauthOptions); } $this->_config->setOptions($oauthOptions); } }
/** * Constructor * * @param string $uri Target URI * @param array|Traversable $options options array (passed to \Zend\Http\Client) */ public function __construct($uri = null, $options = array()) { // If an adapter was not explicitly passed in, set a flag indicating that // we need to recheck the proxy settings whenever the request URI is changed // (since we need different behavior for localhost vs. proxy) if (!isset($options['adapter'])) { $this->checkProxy = true; } // Set up the configuration with the parent class; this will in turn call // our overridden setUri() method and configure the adapter if $uri is set. parent::__construct($uri, $options); }
public function __construct() { parent::__construct(); $this->registry = Registry::getInstance(); }