Example #1
0
 /**
  * data downloaded by CUrl
  * @return string
  */
 protected function &curl()
 {
     $curl = new CUrl();
     //$curl->setProxy();
     $cnb = NULL;
     foreach ($this->links as $key => $link) {
         $curl->setOption(\CURLOPT_URL, $this->fillDate($link));
         if ($curl->getErrorNumber() > 0) {
             if ($key == 0) {
                 throw new ExchangeException('Let\'s check internet connection.');
             }
             continue;
         } else {
             $cnb .= $curl->getResult();
         }
     }
     return $cnb;
 }
Example #2
0
 public function getContent(CUrl $object)
 {
     return curl_multi_getcontent($object->getHandle());
 }
Example #3
0
 /**
  * setup of proxy
  * @param CUrl $curl
  * @return void
  */
 protected function setProxy(CUrl $curl)
 {
     if (self::$proxyName !== NULL) {
         $curl->setOptions(array(\CURLOPT_PROXY => self::$proxyName, \CURLOPT_PROXYPORT => self::$proxyPort, \CURLOPT_PROXYUSERPWD => self::$proxyAuth));
     }
 }