Source for file upgrade_packages.php
Documentation is available at upgrade_packages.php
// Copyright (c) 2002-2003, Luis Argerich, Garland Foster, Eduardo Polidor, et. al.
// All Rights Reserved. See below for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See http://www.gnu.org/copyleft/lesser.html for details.
$gBitSmarty->assign( 'next_step',$step );
$config_file = empty($_SERVER['CONFIG_INC']) ? '../config/kernel/config_inc.php' : $_SERVER['CONFIG_INC'];
// set the maximum execution time to very high
ini_set( "max_execution_time", "86400" );
include_once( $config_file ); // relative, but we know we are in the installer here...
$gBitInstaller->scanPackages( 'admin/upgrade_inc.php' );
// get some nice R1 to R2 specific upgrade info on the screen - should keep users happy...
if( !empty( $_SESSION['upgrade_r1'] ) ) {
if( $rs = $gBitSystem->mDb->query( "SELECT `name` ,`value` FROM `" . BIT_DB_PREFIX . "tiki_preferences`" ) ) {
while( $row = $rs->fetchRow() ) {
$oldPrefs[$row['name']] = $row['value'];
foreach( array_keys( $gBitSystem->mPackages ) as $package ) {
if( @$oldPrefs['package_'. $package] == 'y' ) {
$gBitSmarty->assign( 'upgrading', $upgrading );
'TIKIWIKI18' => 'BONNIE',
'TIKIWIKI19' => 'TIKIWIKI18',
'TIKIWIKI18' => 'BONNIE',
$gBitSmarty->assign( 'upgradeFrom', $gUpgradeFrom );
$gBitSmarty->assign( 'upgradeTo', $gUpgradeTo );
if( !empty( $_REQUEST['upgrade'] ) ) {
if( isset ( $upgradePath[$_REQUEST['upgrade_from']] ) ) {
if( !empty( $gDebug ) || !empty( $_REQUEST['debug'] ) ) {
foreach( $upgradePath[$_REQUEST['upgrade_from']] as $from=> $to ) {
global $gUpgradeFrom, $gUpgradeTo;
$gBitInstaller->scanPackages( 'admin/upgrade_inc.php', FALSE );
$firstPackages = array_flip( array( 'kernel', 'users', 'categories', 'liberty', 'wiki', 'blogs' ) );
// upgrade the ones that are order critical first
foreach( array_keys( $firstPackages ) as $package ) {
$gBitInstaller->upgradePackage( $package );
if( isset ( $secondPackages[$package] ) ) {
unset ( $secondPackages[$package] );
// upgrade remaining packages
foreach( array_keys( $secondPackages ) as $package ) {
$gBitInstaller->upgradePackage( $package );
unset ( $gBitInstaller->mUpgrades );
// If server supports InnoDB for MySql and selected for use
// we traverse all tables in db after upgrade and change engine if needed
if( isset ( $_SESSION['use_innodb'] ) && $_SESSION['use_innodb'] == TRUE ) {
$rs = $gBitInstaller->mDb->Execute("SHOW TABLE STATUS");
$row = $rs->GetRowAssoc(false);
$gBitInstaller->mDb->Execute("ALTER TABLE " . $row['Name'] . " ENGINE = INNODB");
$gBitSmarty->assign( 'package_list', $upPackages );
$gBitSmarty->assign( 'next_step',$step + 1 );
|