From: Reini U. <ru...@us...> - 2004-12-10 22:33:51
|
Update of /cvsroot/phpwiki/phpwiki/lib/plugin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28859/plugin Modified Files: WikiAdminUtils.php Log Message: add WikiAdminUtils method for convert-cached-html missed some vars. Index: WikiAdminUtils.php =================================================================== RCS file: /cvsroot/phpwiki/phpwiki/lib/plugin/WikiAdminUtils.php,v retrieving revision 1.14 retrieving revision 1.15 diff -u -2 -b -p -d -r1.14 -r1.15 --- WikiAdminUtils.php 6 Dec 2004 19:50:05 -0000 1.14 +++ WikiAdminUtils.php 10 Dec 2004 22:33:40 -0000 1.15 @@ -28,4 +28,5 @@ rcs_id('$Id$'); access-restrictions email-verification + convert-cached-html */ class WikiPlugin_WikiAdminUtils @@ -177,4 +178,32 @@ extends WikiPlugin } + + function _do_convert_cached_html(&$request, $args) { + + require_once("lib/upgrade.php"); + _upgrade_db_init($dbh); + + $database = $dbh->_backend->database(); + extract($dbh->_backend->_table_names); + $fields = $dbh->_backend->listOfFields($database, $page_tbl); + if (!strstr(strtolower(join(':', $fields)), "cached_html")) { + $backend_type = $dbh->_backend->backendType(); + if (substr($backend_type,0,5) == 'mysql') + $dbh->genericSqlQuery("ALTER TABLE $page_tbl ADD cached_html MEDIUMBLOB"); + else + $dbh->genericSqlQuery("ALTER TABLE $page_tbl ADD cached_html BLOB"); + } + + $count = _convert_cached_html($dbh); + + if (!$count) + return _("No old _cached_html pagedata found."); + else { + return HTML(fmt("Converted successfully %d pages", $count), + HTML::div(array('align'=>'left'), $list)); + } + } + + //TODO: We need a seperate plugin for this. // Too many options. |