Example #1
0
 /**
  * @param array $options
  * @param ClientInterface $client
  */
 public function __construct(array $options = array(), ClientInterface $client = null)
 {
     $this->_options = (object) array_merge(array('host' => 'localhost', 'port' => '5984', 'path' => '/', 'ssl' => false, 'proxy' => false, 'timeout' => 5, 'name' => null, 'user' => null, 'pass' => null), $options);
     $this->_cookies = new CookieJar();
     if (empty($client)) {
         $client = new Curl();
     }
     $this->_client = $client;
     $this->_client->setTimeout($this->getTimeout());
     if ($this->isSSL()) {
         //      $opts[CURLOPT_SSL_VERIFYPEER] = true;
         //      $opts[CURLOPT_SSL_VERIFYHOST] = true;
         //      $opts[CURLOPT_CAINFO] = $this->sslCertPath;
     }
     if ($this->hasProxy()) {
         $this->_client->setProxy($this->getProxy());
     }
     if ($this->hasAuth()) {
         $this->_auth = (object) array('user' => $this->_options->user, 'pass' => $this->_options->pass);
     }
 }