function Start($aDBServer, $aProjName) { $dbutils = new DBUtils($aDBServer); $dbutils->SetProject($aProjName); $this->iDirectory = $dbutils->GetProjDir($aProjName); $this->iProjName = $aProjName; $proj = $dbutils->GetProject(); $this->iShowPrivate = $dbutils->GetShowPrivate($aProjName); $this->iDocType = $proj['fld_doctype']; $ds = new DocStat($dbutils); list($avg, $nc, $nm) = $ds->ProjStat($aProjName); $t = '<table width=100% border=1 style="background-color:lightblue;"><tr><td align=center><span style="font-size:20pt;font-family:arial;font-weight:bold;">' . $aProjName . "</span></td></tr></table>\n"; $t .= '<div align=center><h3 style="color:darkred;font-family:arial;">Documentation status: ' . round($avg * 100) . '%</h3>'; $t .= '<span style="font-family:arial;">Total number of Classes: ' . $nc . ', Methods: ' . $nm . "</span><p>\n"; if ($this->iShowPrivate) { $t .= '<i>This version <b>includes</b> private methods & classes</i><p>'; } else { $t .= '<i>This version does <b>not</b> include private methods & classes</i><p>'; } $t .= '<p><i>Generated at ' . strftime('%d %b %Y at %H:%M') . "</i><br>\n"; $t .= "</div><hr>"; $t .= "<p>" . $proj['fld_desc']; if ($this->iDocType == 0) { $dt = 'HTML: Multiple files.'; $this->iWriter->Open($this->iDirectory . 'projinfo.html'); $this->iWriter->W($t); $this->iWriter->Close(); $this->iWriter->Open($this->iDirectory . 'index.html'); $this->iWriter->W($this->iIndexFramePage); $this->iWriter->Close(); } else { $dt = 'HTML: Single file.'; $this->iWriter->Open($this->iDirectory . 'index.html'); $this->iWriter->W($this->iIndexPage); $this->iWriter->W($this->iCSS); $this->iWriter->W($t); } HTMLGenerator::CloseWinButton('left'); echo "<hr>"; echo "<font face=arial><b>Generating reference for project : <font color=blue>{$aProjName}</font></b></font><br>"; echo "Output directory: <b><font color=blue>" . $this->iDirectory . '</font></b><br>'; echo "Output format: <b><font color=blue>{$dt}</font></b> <p>\n"; echo "<hr>"; }
function Run($aClass, $aFlags = "") { $dbutils = $this->iDBCache->iDBUtils; $dbutils->SetProject($this->iProjname); $proj = $dbutils->GetProject(); $docdir = $proj['fld_docdir']; $showPrivate = $proj['fld_showprivate']; $docType = $proj['fld_doctype']; $showGlobFuncs = $proj['fld_showglobfuncs']; $this->iDBCache->RefreshClasses(); $this->iDBCache->RefreshMethods(); $fmt = $this->NewClassFormatter($this->iDBCache, $aFlags); $fmt->Init($this->iProjname, $proj['fld_desc'], $docType, $docdir, $showPrivate, $showGlobFuncs); $ds = new DocStat($dbutils); list($avg, $nc, $nm) = $ds->ProjStat($this->iProjname); $fmt->InitStat($avg, $nc, $nm); $fmt->Start(); // Format all the classes and their methods $cr = new ClassReader($fmt, $this->iDBCache, $aFlags); $cr->SetNumIndexCols($this->iNumIndexCols); $cr->Run($aClass); // Format all global functions if ($showGlobFuncs) { $gf = new GlobalFuncReader($fmt, $this->iDBCache, $aFlags); $gf->Run(); } $fmt->End(); }