function CloseDataBase($dbi) { reset($dbi); while (list($dbmfile, $dbihandle) = each($dbi)) { dbmclose($dbihandle); } return; }
$content = implode("\n", $pagehash['text']); $content = str_replace("[", "[[", $content); $newhash['content'] = explode("\n", $content); InsertPage($dbi, $pagename, $newhash); } echo "opening dbm file: {$portdbmfile} ... \n"; if (!file_exists($portdbmfile)) { echo "File '{$portdbmfile}' does not exist.<br>\n"; exit; } if (!($dbmh = dbmopen($portdbmfile, "r"))) { echo "Cannot open '{$portdbmfile}'<br>\n"; exit; } echo " ok ({$dbmh})<p>\n"; $namelist = array(); $ctr = 0; $namelist[$ctr] = $key = dbmfirstkey($dbmh); port1_0renderhash($dbi, $dbmh, $key); while ($key = dbmnextkey($dbmh, $key)) { $ctr++; $namelist[$ctr] = $key; port1_0renderhash($dbi, $dbmh, $key); } dbmclose($dbmh); ?> <p><b>Done.</b> </body> </html>
function dba_close($handle) { return dbmclose($handle); }