getDB(); switch ($STEP) { case 1: echo '
the table log will be altered
'; echo 'Upgrade'; break; case 2: $db->isTransactionSupported() and $db->startTransaction(); foreach ($TABLESDEF as $tabledef) { $tableInfo = MFDBTableInfo::fromXML($tabledef); // correcting some columns in log table if ($tableInfo->getName() == 'log') { $db->table('log')->alterColumn('area', $tableInfo->getColumnInfo('area')); $db->table('log')->alterColumn('areaname', $tableInfo->getColumnInfo('areaname')); $db->table('log')->alterColumn('user', $tableInfo->getColumnInfo('user')); $db->table('log')->alterColumn('code', $tableInfo->getColumnInfo('code')); echo ''.$tableInfo->getName().' altered (area, areaname, user, code)
'; } } $db->table('installinfo')->delete(array('type' =>'system', 'key' => 'mcms')); $db->table('installinfo')->delete(array('type' =>'system', 'key' => 'mcmsdb')); $db->table('installinfo')->insert(array('type' =>'system', 'key' => 'mcms', 'version' => MCMS, 'attrib' => 0)); $db->table('installinfo')->insert(array('type' =>'system', 'key' => 'mcmsdb', 'version' => $TABLESDEF['version'], 'attrib' => 0)); $db->isTransactionSupported() and $db->commit(); echo 'upgrade finished, remove the install folder and return to your system
'; echo 'Back to main page'; break; }