\n";
if (! file_exists($directory)) {
echo "No such directory '$directory'.
\n";
exit;
}
$handle = opendir($directory);
while ($file = readdir($handle)) {
if ($file[0] == ".")
continue;
$html .= "Reading '$file'...
\n";
$data = implode("", file("$directory/$file"));
$pagehash = unserialize($data);
// at this point there needs to be some form of verification
// that we are about to insert a page.
$pagename = rawurldecode($file);
$html .= "inserting file '".htmlspecialchars($pagename)."' into the database...
\n";
InsertPage($dbi, $pagename, $pagehash);
}
closedir($handle);
$html .= "
Load complete."; GeneratePage('MESSAGE', $html, 'Load serialized pages', 0); ExitWiki(''); ?>