예제 #1
0
 /**
  * @return array
  */
 public function getCurlOptions()
 {
     $headers = array();
     foreach ($this->headers as $key => $val) {
         $headers[] = strtr(ucwords(strtr($key, '-', ' ')), ' ', '-') . ': ' . $val;
     }
     $url = $this->getURL();
     $curlOpts = array(CURLOPT_URL => $url, CURLOPT_HTTPHEADER => $headers, CURLOPT_USERAGENT => ConfigFacade::getUserAgent());
     $curlOpts += static::$defaultCurlOptions;
     // @codeCoverageIgnoreStart
     if ($ciphers = $this->nssCiphers()) {
         $curlOpts[CURLOPT_SSL_CIPHER_LIST] = $ciphers;
     }
     // @codeCoverageIgnoreEnd
     if ($proxy = $this->getProxy($url)) {
         $curlOpts[CURLOPT_PROXY] = $proxy;
     }
     if ($this->capath) {
         $curlOpts[CURLOPT_CAPATH] = $this->capath;
     }
     if ($this->cafile) {
         $curlOpts[CURLOPT_CAINFO] = $this->cafile;
     }
     return $curlOpts;
 }
예제 #2
0
 public function testConstruct()
 {
     $config = new ConfigFacade();
     self::assertInternalType('string', $config->getUserAgent());
 }