function Run($aProjname, $aForceUpdate = false) { $this->iProjname = $aProjname; echo "<h3>Scanning files for project '{$aProjname}'</h3>"; // Find full filename of all project files in the project $proj = $this->iDBUtils->GetProject($aProjname); $projidx = $proj['fld_key']; $q = "SELECT * FROM tbl_projfiles WHERE fld_projidx={$projidx}"; $res = $this->iDB->Query($q); $n = $res->NumRows(); $ptimer = new JpgTimer(); while ($n-- > 0) { $r = $res->Fetch(); $fname = $r['fld_name']; $modtime = filemtime($fname); $dbtime = strtotime($r['fld_dbupdtime']); if ($aForceUpdate || $modtime > $dbtime) { echo "Parsing file {$fname}...\n"; flush(); $dbdriver = new DBDriver($aProjname, $fname, $this->iDB); $ptimer->Push(); $dbdriver->Run(); $t = round($ptimer->Pop() / 1000, 2); $q = "UPDATE tbl_projfiles SET fld_dbupdtime=now() WHERE fld_key=" . $r['fld_key']; $this->iDB->Query($q); echo "[{$t} s]<br>\n"; } else { echo "DB is up to date with file: '{$fname}'<br>\n"; } } echo "<p><h3>Done.</h3>"; HTMLGenerator::CloseWinButton(); }
$i = 1; foreach ($allfiles as $f) { $buf .= "<h4>Theme {$i} (<i>" . $names[$i - 1] . ")</i></h4>\n"; $buf .= sprintf($frm, basename($f)); ++$i; } $fp = fopen(CACHE_DIR . "themes.html", "w"); if (!$fp) { die("Can't create index file."); } fwrite($fp, $buf); fclose($fp); echo "<br>"; } $th = array("earth" => array(22, 424, 10, 34, 40, 45, 49, 62, 63, 74, 77, 119, 120, 134, 136, 141, 168, 180, 209, 218, 346, 395, 89, 430), "pastel" => array(22, 424, 27, 38, 42, 58, 66, 79, 105, 110, 128, 147, 152, 230, 240, 331, 337, 405, 415), "water" => array(22, 424, 8, 10, 14, 24, 56, 213, 237, 268, 326, 335, 370, 387, 388), "sand" => array(22, 424, 19, 34, 50, 65, 72, 82, 131, 168, 209)); echo "<h2>JpGraph color chart</h2>"; echo "Generating color chart images ...<br>\n"; flush(); $timer = new JpgTimer(); $timer->Push(); GenColIndex(); echo "<p>Generating themes..."; GenThemes($th); $t = $timer->Pop() / 1000; $t = sprintf("<p>Work done in: %0.2f seconds.", round($t, 2)); echo "{$t}<p>See <a href=\"" . CACHE_DIR . "colorchart.html\">Colorchart</a>\n"; echo "<br>See <a href=\"" . CACHE_DIR . "themes.html\">Index of themes</a>\n"; ?>
function Stroke($aImg) { $y = $aImg->height - $this->iBottomMargin; $x = $this->iLeftMargin; $this->left->Align('left', 'bottom'); $this->left->Stroke($aImg, $x, $y); $x = ($aImg->width - $this->iLeftMargin - $this->iRightMargin) / 2; $this->center->Align('center', 'bottom'); $this->center->Stroke($aImg, $x, $y); $x = $aImg->width - $this->iRightMargin; $this->right->Align('right', 'bottom'); if ($this->iTimer != null) { $this->right->Set($this->right->t . sprintf('%.3f', $this->iTimer->Pop() / 1000.0) . $this->itimerpoststring); } $this->right->Stroke($aImg, $x, $y); }
function Run($aProject) { $this->iProject = $aProject; $timer = new JpgTimer(); echo "<h3>DB Consistency check for project: <font color=blue>{$aProject}</font></h3><hr>"; $timer->Push(); //echo HTMLGenerator::CloseWinButton(); echo "<i>This will verify the integrity of the keys in the database as well as foreign key references. "; echo "It will also perform various consistency check within the methods and classes.</i>"; echo '<hr>'; echo "<h4>Reading project information ... </h4>\n"; flush(); $this->nm = $this->ReadMethods(); $this->nc = $this->ReadClasses(); echo "Classes: {$this->nc},   Methods: {$this->nm} <br>"; echo "<h4>Checking methods ... </h4>\n"; flush(); $this->ChkMethods(); echo "<h4>Checking classes ... </h4>\n"; flush(); $this->ChkClasses(); $t = round($timer->Pop() / 1000, 2); $t = "{$t}" . 's'; if ($this->iErrCnt > 0) { $color = 'red'; } else { $color = 'blue'; } echo " <p> <font color={$color}><b>Found " . $this->iErrCnt . " errors.</b></font>"; echo '<hr> '; echo "\n<table width=100%><tr><td>Time: {$t} </td><td align=right> <form><input type=button value='Close Windows' onclick='window.close();'></form></td></tr></table>"; }