From: Charles C. <ch...@ru...> - 2004-12-11 01:50:45
|
Reini, In file upgrade.php, function CheckDatabaseUpdate(&$request), somewhere before line 355 of the file, something like $dbh = &$request->_dbi; Is needed to make it work Regards, Charles -----Original Message----- From: Reini Urban [mailto:ru...@us...] Sent: 11 December 2004 06:34 To: php...@li... Subject: [phpwiki-checkins] CVS: phpwiki/lib upgrade.php,1.32,1.33 Update of /cvsroot/phpwiki/phpwiki/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28859 Modified Files: upgrade.php Log Message: add WikiAdminUtils method for convert-cached-html missed some vars. Index: upgrade.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/upgrade.php,v retrieving revision 1.32 retrieving revision 1.33 diff -u -2 -b -p -d -r1.32 -r1.33 --- upgrade.php 10 Dec 2004 22:15:00 -0000 1.32 +++ upgrade.php 10 Dec 2004 22:33:39 -0000 1.33 @@ -453,5 +453,5 @@ function CheckDatabaseUpdate(&$request) function _upgrade_db_init (&$dbh) { - global $DBParams, $DBAuthParams; + global $request, $DBParams, $DBAuthParams; if (!in_array($DBParams['dbtype'], array('SQL','ADODB'))) return; if (defined('DBADMIN_USER') and DBADMIN_USER) { @@ -491,4 +491,5 @@ function _upgrade_cached_html (&$dbh) { if (!strstr(strtolower(join(':', $fields)), "cached_html")) { echo "<b>",_("ADDING"),"</b>"," ... "; + $backend_type = $dbh->_backend->backendType(); if (substr($backend_type,0,5) == 'mysql') $dbh->genericSqlQuery("ALTER TABLE $page_tbl ADD cached_html MEDIUMBLOB"); @@ -514,4 +515,6 @@ function _convert_cached_html (&$dbh) { $pages = $dbh->getAllPages(); $cache =& $dbh->_cache; + $count = 0; + extract($dbh->_backend->_table_names); while ($page = $pages->next()) { $pagename = $page->getName(); @@ -524,6 +527,8 @@ function _convert_cached_html (&$dbh) { $dbh->genericSqlQuery("UPDATE $page_tbl SET cached_html=? WHERE pagename=?", array($cached_html, $pagename)); + $count++; } } + return $count; } @@ -631,4 +636,8 @@ function DoUpgrade($request) { /** $Log$ + Revision 1.33 2004/12/10 22:33:39 rurban + add WikiAdminUtils method for convert-cached-html + missed some vars. + Revision 1.32 2004/12/10 22:15:00 rurban fix $page->get('_cached_html) |