/** * 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; }
public function getContent(CUrl $object) { return curl_multi_getcontent($object->getHandle()); }
/** * 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)); } }