<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Method Details</title>
<link rel="stylesheet" type="text/css" media="screen" href="style.css">
<script name="javascript">
function show_hide_examples(mode)
{
if (document.getElementById("examples").style.display == "none")
{
document.getElementById("examples").style.display = "";
}
else
{
document.getElementById("examples").style.display = "none";
}
}
</script>
</head>
<body>
<div id="outer">
<h1 id="head">
<span>Method:
PHPCrawler::handleHeaderInfo()</span>
</h1>
<h2 id="head">
<span><a href="overview.html"><< Back to class-overview</a></span>
</h2>
<br>
<div id="section">
Overridable method that will be called after the header of a document was received and BEFORE the content<br>will be received.
</div>
<div id="section">
<b>Signature:</b>
<p id="signature">
public handleHeaderInfo(PHPCrawlerResponseHeader $header)
</p>
</div>
<div id="section">
<b>Parameters:</b>
<p>
<table id="param_list">
<tr><td id="paramname" width="1%"><b>$header</b> </td><td width="1%"><i><a href="../PHPCrawlerResponseHeader/overview.html" class="inline">PHPCrawlerResponseHeader</a></i> </td><td width="*">The header as PHPCrawlerResponseHeader-object</td></tr>
</table>
</p>
</div>
<div id="section">
<b>Returns:</b>
<p>
<table id="param_list">
<tr> <td width="1%"><i><i>int</i></i> </td> <td width="*"> The document won't be received if you let this method return any negative value.</td></tr>
</table>
</p>
</div>
<div id="section">
<b>Description:</b>
<p>
Everytime a header of a document was received, the crawler will call this method.<br>If this method returns any negative integer, the crawler will NOT reveice the content of the particular page or file.<br><br>Example:<code>class MyCrawler extends PHPCrawler <br>{<br> function handleHeaderInfo(PHPCrawlerResponseHeader $header)<br> {<br> // If the content-type of the document isn't "text/html" -> don't receive it.<br> if ($header->content_type != "text/html")<br> {<br> return -1;<br> } <br> }<br><br> function handleDocumentInfo($PageInfo)<br> {<br> // ...<br> }<br>}</code>
</p>
</div>
</div>
<div id="footer">Docs created with <a href="http://phpclassview.cuab.de" target="_parent">PhpClassView</a></div>
</body>
</html>