/** * Get cURL response * * @param string * @return string */ private function getCurlResponse($url) { $res = new \Nella\Utils\Curl\Request($url); $res->setUserAgent("Mozilla/5.0 (compatible; Nella\\Panels\\Version/".self::VERSION."; http://addons.nette.org/cs/versionpanel)"); $res->setOption('returntransfer', TRUE)->setOption('header', TRUE)->setOption('followlocation', TRUE)->setOption('ssl_verifypeer', FALSE); $res->setHeader('HTTP_ACCEPT', "text/javascript,text/json,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8*/*;q=0.5"); $res->setHeader('HTTP_ACCEPT_CHARSET', "windows-1250,utf-8;q=0.7,*;q=0.7")->setHeader('HTTP_KEEP_ALIVE', "300"); $res->setHeader('HTTP_CONNECTION', "keep-alive"); return $res->response->body; }
public function setup() { $req = new \Nella\Utils\Curl\Request("http://www.google.com"); $this->response = $req->getResponse(); }