[Phpbb-php5mod-cvs-checkins] phpbb-php5/install update_to_20133.php,NONE,1.1
Brought to you by:
jelly_doughnut
From: Josh <jel...@us...> - 2005-02-28 01:01:11
|
Update of /cvsroot/phpbb-php5mod/phpbb-php5/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31243/install Added Files: update_to_20133.php Log Message: 2.0.12.3 --- NEW FILE: update_to_20133.php --- <?php /*************************************************************************** * update_to_20xy.php * ------------------- * begin : Friday, Nov. * copyright : (C) 2005 phpBB-php5 * email : n/a * * $Id: update_to_20133.php,v 1.1 2005/02/28 01:01:01 jelly_doughnut Exp $ * * ***************************************************************************/ /*************************************************************************** * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * ***************************************************************************/ // This script is basically phpBB's update_to_20x.php // Except it doesn't have information to upgrade from ancient versions. function _sql($sql, &$errored, &$error_ary, $echo_dot = true) { global $db; if (!($result = $db->sql_query($sql))) { $errored = true; $error_ary['sql'][] = (is_array($sql)) ? $sql[$i] : $sql; $error_ary['error_code'][] = $db->sql_error(); } if ($echo_dot) { echo ". \n"; flush(); } return $result; } @set_time_limit(120); define('IN_PHPBB', 1); $phpbb_root_path = './../'; include($phpbb_root_path . 'extension.inc'); include($phpbb_root_path . 'config.'.$phpEx); if(!isset($dbms)) { die("Please read: <a href='../docs/INSTALL.html'>INSTALL.html</a> before attempting to update."); } include($phpbb_root_path . 'includes/constants.'.$phpEx); include($phpbb_root_path . 'includes/functions.'.$phpEx); include($phpbb_root_path . 'includes/functions_admin.'.$phpEx); include($phpbb_root_path . 'includes/functions_search.'.$phpEx); include($phpbb_root_path . 'includes/db.'.$phpEx); // // // $updates_to_version = ".0.13"; $update_php5mod_version = ".0.13.3"; // // // ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html;"> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"> <!-- font,th,td,p,body { font-family: "Courier New", courier; font-size: 11pt } a:link,a:active,a:visited { color : #006699; } a:hover { text-decoration: underline; color : #DD6900;} hr { height: 0px; border: solid #D1D7DC 0px; border-top-width: 1px;} .maintitle,h1,h2 {font-weight: bold; font-size: 22px; font-family: "Trebuchet MS",Verdana, Arial, Helvetica, sans-serif; text-decoration: none; line-height : 120%; color : #000000;} .ok {color:green} /* Import the fancy styles for IE only (NS4.x doesn't use the @import function) */ @import url("../templates/subSilver/formIE.css"); --> </style> </head> <body bgcolor="#FFFFFF" text="#000000" link="#006699" vlink="#5584AA"> <table width="100%" border="0" cellspacing="0" cellpadding="10" align="center"> <tr> <td><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="../templates/subSilver/images/logo_phpBB.gif" border="0" alt="Forum Home" vspace="1" /></td> <td align="center" width="100%" valign="middle"><span class="maintitle">Updating to latest stable release</span></td> </tr> </table></td> </tr> </table> <br clear="all" /> <h2>Information</h2> <?php echo '<p>Database type :: <b>' . SQL_LAYER . '</b><br />'; $sql = "SELECT config_value FROM " . CONFIG_TABLE . " WHERE config_name = 'version'"; if (!($result = $db->sql_query($sql))) { die("Couldn't obtain version info"); } $row = $db->sql_fetchrow($result); $sql = array(); echo 'Previous version :: <b>2' . $row['config_value'] . '</b><br />'; echo 'Updated version :: <b>2' . $updates_to_version . '</b></p>' ."\n"; echo "<h2>Updating database schema</h2>\n"; echo "<p>Progress :: <b>"; flush(); // // Data updates // unset($sql); $error_ary = array(); $errored = false; echo "<h2>Updating data</h2>\n"; echo "<p>Progress :: <b>"; flush(); echo " No updates where required</b></p>\n"; echo "<h2>Updating version and optimizing tables</h2>\n"; echo "<p>Progress :: <b>"; flush(); // update the version $sql = "UPDATE " . CONFIG_TABLE . " SET config_value = '$updates_to_version' WHERE config_name = 'version'"; _sql($sql, $errored, $error_ary); $sql = "UPDATE " . CONFIG_TABLE . " SET config_value = '$update_php5mod_version' WHERE config_name = 'version5'"; _sql($sql, $errored, $error_ary); // Optimize/vacuum analyze the tables where appropriate // this should be done for each version in future along with // the version number update switch (SQL_LAYER) { case 'mysql': case 'mysql4': $sql = 'OPTIMIZE TABLE ' . $table_prefix . 'auth_access, ' . $table_prefix . 'banlist, ' . $table_prefix . 'categories, ' . $table_prefix . 'config, ' . $table_prefix . 'disallow, ' . $table_prefix . 'forum_prune, ' . $table_prefix . 'forums, ' . $table_prefix . 'groups, ' . $table_prefix . 'posts, ' . $table_prefix . 'posts_text, ' . $table_prefix . 'privmsgs, ' . $table_prefix . 'privmsgs_text, ' . $table_prefix . 'ranks, ' . $table_prefix . 'search_results, ' . $table_prefix . 'search_wordlist, ' . $table_prefix . 'search_wordmatch, ' . $table_prefix . 'smilies, ' . $table_prefix . 'themes, ' . $table_prefix . 'themes_name, ' . $table_prefix . 'topics, ' . $table_prefix . 'topics_watch, ' . $table_prefix . 'user_group, ' . $table_prefix . 'users, ' . $table_prefix . 'vote_desc, ' . $table_prefix . 'vote_results, ' . $table_prefix . 'vote_voters, ' . $table_prefix . 'words'; _sql($sql, $errored, $error_ary); break; case 'postgresql': _sql("VACUUM ANALYZE", $errored, $error_ary); break; } echo "</b> <b class=\"ok\">Done</b><br />Result :: \n"; if ($errored) { echo " <b>Some queries failed, the statements and errors are listing below</b>\n<ul>"; for ($i = 0; $i < count($error_ary['sql']); $i++) { echo "<li>Error :: <b>" . $error_ary['error_code'][$i]['message'] . "</b><br />"; echo "SQL :: <b>" . $error_ary['sql'][$i] . "</b><br /><br /></li>"; } echo "</ul>\n<p>This is probably nothing to worry about, update will continue. Should this fail to complete you may need to seek help at our development board. See <a href=\"docs\README.html\">README</a> for details on how to obtain advice.</p>\n"; } else { echo "<b>No errors</b>\n"; } echo "<h2>Update completed</h2>\n"; echo "\n<p>You should now visit the General Configuration settings page in the <a href=\"../admin/\">Administration Panel</a> and check the General Configuration of the board. If you updated from versions prior to RC-3 you <b>must</b> update some entries. If you do not do this emails sent from the board will contain incorrect information. Don't forget to delete this file!</p>\n"; ?> <br clear="all" /> </body> </html> |