示例#1
0
 /**
  * 
  * @param ymcPipeExecution $execution 
  * @param ymcCurlResponse  $input 
  * @return ymcPipeHtmlDomDocument
  */
 public function processInput(ymcPipeExecution $execution, $input)
 {
     //var_dump( $input );
     if ($input instanceof ymcCurlResponse) {
         $dom = ymcPipeHtmlDomDocument::createFromHtml((string) $input, $input->getCharset());
         return $dom;
     } else {
         throw new ymcPipeNodeWrongInputException($this->typename, $input, 'ymcCurlResponse');
     }
 }
示例#2
0
 public function onCompletion()
 {
     $ch = $this->curlHandle;
     $this->checkForError($ch);
     $this->curlInfo = curl_getinfo($ch);
     $response = new ymcCurlResponse();
     $response->url = $this->url;
     $response->body = $this->receivedBody;
     $response->header = $this->receivedHeader;
     $response->received = new DateTime();
     $response->parseCurlInfo($this->curlInfo);
     $response->contentLanguage = $response->getHeader('Content-Language', '\\n');
     $this->response = $response;
     $this->closeHandle();
 }