content(file_get_contents($source."index.html"));
writeFile('tutorials/index.html', $page->out());
// Start making the individual tutorial pages
if( ! $xml = simplexml_load_file($source.'tutorials.xml') )
{
echo 'XML file missing';
}
else
{
foreach( $xml as $tutorial )
{
$title = $tutorial->title;
$directory = $tutorial->directory;
$imgs = $tutorial->imgs;
$code = $tutorial->code;
echo 'About to generate tutorial '.$title.' in directory '.$directory.', imgs dir = '.$imgs.', code dir = '.$code.'
';
echo 'Copying '.$source.$directory.'/index.html to ' . 'tutorials/'.$directory.'/index.html
';
$page = new Page($title, "Tutorials", "Tutorials", "../../");
$page->content(file_get_contents($source.$directory.'/index.html'));
writeFile('tutorials/'.$directory.'/index.html', $page->out());
if ($imgs == 'true') {
$newpath = $path.'tutorials/'.$directory.'/imgs';
if (!is_dir($newpath)) {
mkdir($newpath, 0757);
}
if (is_dir($newpath)) {
copydirr($source.$directory.'/imgs', $newpath, null, 0757, true);
}
}
if ($code == 'true') {
$newpath = $path.'tutorials/'.$directory.'/code';
if (!is_dir($newpath)) {
mkdir($newpath, 0757);
}
if (is_dir($newpath)) {
copydirr($source.$directory.'/code', $newpath, null, 0757, true);
}
}
}
}
$benchmark_end = microtime_float();
$execution_time = round($benchmark_end - $benchmark_start, 4);
?>
Generated files in =$execution_time?> seconds.