"; echo "old_dir $old_dir
"; echo "old pages dbm: $old_dbm_pages
"; echo "old archive dbm: $old_dbm_archive
"; echo "new dir: $new_dir
"; echo "new pages dbm: $new_dbm_pages
"; echo "new archive dbm: $new_dbm_archive
"; echo "
\n"; // open old pages DBM file $old_dbm_fh = dba_open($old_dbm_pages, "r", "gdbm"); $new_dbm_fh = dba_open($new_dbm_pages, "c", "gdbm"); $pagename = dba_firstkey($old_dbm_fh); $pagehash = unserialize(dba_fetch($pagename, $old_dbm_fh)); echo "
"; while( list($key, $val) = each($pagehash)) { echo "
$key
$val"; } $new_ph["content"] = $pagehash["text"]; $new_ph["author"] = $pagehash["author"]; $new_ph["version"] = $pagehash["version"]; $new_ph["date"] = $pagehash["date"]; $new_ph["flags"] = 0; $new_ph["lastmodified"] = 0; $new_ph["created"] = 0; $new_ph["refs"] = array(); InsertPage($new_dbm_fh, $pagename, $new_ph); while ($pagename = dba_nextkey($old_dbm_fh)) { $pagehash = unserialize(dba_fetch($pagename, $old_dbm_fh)); while( list($key, $val) = each($pagehash)) { echo "
$key
$val"; $new_ph["content"] = $pagehash["text"]; $new_ph["author"] = $pagehash["author"]; $new_ph["version"] = $pagehash["version"]; $new_ph["date"] = $pagehash["date"]; $new_ph["flags"] = 0; $new_ph["lastmodified"] = 0; $new_ph["created"] = 0; $new_ph["refs"] = array(); InsertPage($new_dbm_fh, $pagename, $new_ph); } } // open old DBM archive file $old_dbm_fh = dba_open($old_dbm_archive, "r", "gdbm"); $new_dbm_fh = dba_open($new_dbm_archive, "c", "gdbm"); $pagename = dba_firstkey($old_dbm_fh); $pagehash = unserialize(dba_fetch($pagename, $old_dbm_fh)); echo "
"; while( list($key, $val) = each($pagehash)) { echo "
$key
$val"; } $new_ph["content"] = $pagehash["text"]; $new_ph["author"] = $pagehash["author"]; $new_ph["version"] = $pagehash["version"]; $new_ph["date"] = $pagehash["date"]; $new_ph["flags"] = 0; $new_ph["lastmodified"] = 0; $new_ph["created"] = 0; $new_ph["refs"] = array(); InsertPage($new_dbm_fh, $pagename, $new_ph); while ($pagename = dba_nextkey($old_dbm_fh)) { $pagehash = unserialize(dba_fetch($pagename, $old_dbm_fh)); while( list($key, $val) = each($pagehash)) { echo "
$key
$val"; $new_ph["content"] = $pagehash["text"]; $new_ph["author"] = $pagehash["author"]; $new_ph["version"] = $pagehash["version"]; $new_ph["date"] = $pagehash["date"]; $new_ph["flags"] = 0; $new_ph["lastmodified"] = 0; $new_ph["created"] = 0; $new_ph["refs"] = array(); InsertPage($new_dbm_fh, $pagename, $new_ph); } } ?>