Skip to content
Snippets Groups Projects
Commit 6fb2a75e authored by Brett Bieber's avatar Brett Bieber
Browse files

Go back to the default downloader, throw errors on pages with bad links.

parent e6a7034b
Branches
No related tags found
No related merge requests found
......@@ -5,6 +5,16 @@
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.dltk.core.scriptbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
</natures>
......
......@@ -95,7 +95,11 @@ class Spider
foreach ($subUris as $subUri) {
if (!array_key_exists($subUri, $this->visited)) {
try {
$this->spiderPage($baseUri, $subUri, $depth + 1);
} catch(Exception $e) {
echo "The page, ".$uri.' linked to a page that could not be accessed: ' . $subUri.'<br />';
}
}
}
}
......
......@@ -18,7 +18,7 @@ class UNL_WDN_Assessment
protected function getSpider()
{
$plogger = new UNL_WDN_Assessment_PageLogger($this);
$downloader = new UNL_WDN_Assessment_PageDownloader();
$downloader = new Spider_Downloader();
$parser = new Spider_Parser();
$spider = new Spider($downloader, $parser);
......
<?php
class UNL_WDN_Assessment_PageDownloader extends Spider_Downloader
{
protected $assessment;
function __construct(UNL_WDN_Assessment $assessment)
{
$this->assessment = $assessment;
}
public function download($uri)
{
try {
return parent::download($uri);
} catch(Exception $e) {
echo 'Link to missing page. '.$uri;
}
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment