From: Geoffrey T. D. <da...@us...> - 2001-02-07 02:23:08
|
Update of /cvsroot/phpwiki/phpwiki/admin In directory usw-pr-cvs1:/tmp/cvs-serv11175/admin Modified Files: zip.php Log Message: Fix bug #131024: full zip dump hangs when using dbalib.php (and perhaps other) backends. Index: zip.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/admin/zip.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -r1.1 -r1.2 *** zip.php 2000/11/08 15:30:16 1.1 --- zip.php 2001/02/07 02:23:24 1.2 *************** *** 1,5 **** <?php // $Id$ ! function MailifyPage ($pagehash, $archive = false) { global $SERVER_ADMIN, $ArchivePageStore; --- 1,5 ---- <?php // $Id$ ! function MailifyPage ($pagehash, $oldpagehash = false) { global $SERVER_ADMIN, $ArchivePageStore; *************** *** 13,23 **** $head .= "Mime-Version: 1.0 (Produced by PhpWiki 1.1.x)\r\n"; ! if ($archive) { ! $oldpage = RetrievePage($archive, $pagehash['pagename'], $ArchivePageStore); ! if (is_array($oldpage)) ! return $head . MimeMultipart(array(MimeifyPage($oldpage), ! MimeifyPage($pagehash))); } return $head . MimeifyPage($pagehash); } --- 13,22 ---- $head .= "Mime-Version: 1.0 (Produced by PhpWiki 1.1.x)\r\n"; ! if (is_array($oldpagehash)) { ! return $head . MimeMultipart(array(MimeifyPage($oldpagehash), ! MimeifyPage($pagehash))); } + return $head . MimeifyPage($pagehash); } *************** *** 38,42 **** if ($include_archive) { - $dba = OpenDataBase($ArchivePageStore); $zipname = "wikidb.zip"; } --- 37,40 ---- *************** *** 48,53 **** --- 46,58 ---- set_time_limit(30); // Reset watchdog. $pagehash = RetrievePage($dbi, $pagename, $WikiPageStore); + if (! is_array($pagehash)) continue; + + if ($include_archive) + $oldpagehash = RetrievePage($dbi, $pagename, $ArchivePageStore); + else + $oldpagehash = false; + $attrib = array('mtime' => $pagehash['lastmodified'], 'is_ascii' => 1); *************** *** 55,59 **** $attrib['write_protected'] = 1; ! $content = MailifyPage($pagehash, $dba); $zip->addRegularFile( rawurlencode($pagehash['pagename']), --- 60,64 ---- $attrib['write_protected'] = 1; ! $content = MailifyPage($pagehash, $oldpagehash); $zip->addRegularFile( rawurlencode($pagehash['pagename']), *************** *** 61,67 **** } $zip->finish(); - - if ($dba) - CloseDataBase($dba); } --- 66,69 ---- |