public function execute(Request $old_request, Request $new_request) { $this->_columns[$this->_filter->getName() . '_old'] = $old_request->getResponseInfo()["http_code"]; $this->_columns[$this->_filter->getName() . '_new'] = $new_request->getResponseInfo()["http_code"]; return $this->_columns; }
/** * gets response header value. * @param Request $request curl request * @param string $key header hey. * @return string header value. */ public function responseHeader(Request $request, $key) { $info = $request->getResponseInfo(); return @$info[$key]; }
/** * The RollingCurl callback function * * @param Request $request The request object * @param RollingCurl $rolling_curl The current RollingCurl object * @return void */ public function theCallback(Request $request, RollingCurl $rollingCurl) { // dd($request->getResponseInfo()); $url = $request->getUrl(); $html = $request->getResponseText(); $httpCode = array_get($request->getResponseInfo(), 'http_code'); // Add URL to index (or update count) $this->getWebCache()->add($url); if ($httpCode >= 200 && $httpCode < 400 && !empty($html)) { $matches = []; // Parse - Links $this->getParser()->parseLinks($request, $rollingCurl); // Parse - Emails // $this->parseEmails($html); // Garbage collect unset($html); } $this->crawlUrls(); // dd($this->getWebCache()->all()); // return $newLinks; }