Location: PHPKode > projects > phpDocMaker > genDoc.php
<?

	// main file

require ("phpDocMaker.conf.inc");

$connection=doConnection();

echo "<b>genDoc:</b>Browsing all files in $baseDir tree, looking for modified files<br>";

browseDir();

// Cleaning the tmpData table
ExecRequest("delete from tmpData",$connection);
ExecRequest("alter table tmpData, auto_increment=0;",$connection);

echo "<form name='affProgress'><input type='text' name='progress' size='100'></form>";

$resFile=ExecRequest("select * from files where hasChanged=1 order by id_file",$connection);
$nbFichier=mysql_num_rows($resFile);
$fNum=1;

flush();

while($scanFile=mysql_fetch_object($resFile))
{
	$fileName=$scanFile->path.$scanFile->name;
	//echo "<p></p><b>genDoc:</b> Starting processing file <b><i>$fileName</i></b><br>\n";
	echo "<script language='javascript'>document.forms['affProgress']['progress'].value='$fNum/$nbFichier - $fileName'</script>";
	$fNum++;
	flush();
	$myDoc=new docParser();
	$myDoc->iniParser($fileName);
	$myDoc->doParsing();
	$myDoc->endDocParser();
	unset($myDoc);
}
echo "<script language='javascript'>document.forms['affProgress']['progress'].value='Finished - $nbFichier scanned'</script>";

// Now taking into account new data from tmpData table
// => calling myDocParser with no parameter
if($doParseTmp)
{
	echo "<p></p><b>genDoc:</b> Processing data from tmpData<br>\n";
	$myDoc=new docParser();
	$myDoc->parseTmpData();
	unset($myDoc);
}

// Cleaning files database from deleted files

ExecRequest("delete from files where isStillPresent=0",$connection);

echo "<b>genDoc:</b> End<br>\n";
?>
Return current item: phpDocMaker