Method: PHPCrawler::handleHeaderInfo()



Overridable method that will be called after the header of a document was received and BEFORE the content
will be received.
Signature:

public handleHeaderInfo(PHPCrawlerResponseHeader $header)

Parameters:

$header PHPCrawlerResponseHeader The header as PHPCrawlerResponseHeader-object

Returns:

int  The document won't be received if you let this method return any negative value.

Description:

Everytime a header of a document was received, the crawler will call this method.
If this method returns any negative integer, the crawler will NOT reveice the content of the particular page or file.

Example:class MyCrawler extends PHPCrawler
{
  function handleHeaderInfo(PHPCrawlerResponseHeader $header)
  {
    // If the content-type of the document isn't "text/html" -> don't receive it.
    if ($header->content_type != "text/html")
    {
      return -1;
    }  
  }

  function handleDocumentInfo($PageInfo)
  {
    // ...
  }
}