private static function calcOffsets(GDO_Database $db_from, GDO_Database $db_to, array &$db_offsets, $prefix, $prevar) { $classnames = array('WC_Challenge', 'WC_Site', 'WC_Warbox', 'WC_Warflag', 'WC_MathChall'); foreach ($classnames as $classname) { merge_calc_offset($db_from, $db_to, $db_offsets, $classname); } }
private static function calcOffsets(GDO_Database $db_from, GDO_Database $db_to, array &$db_offsets, $prefix, $prevar) { $classnames = array('GWF_ForumAttachment', 'GWF_ForumPost', 'GWF_ForumPostHistory', 'GWF_ForumThread'); foreach ($classnames as $classname) { merge_calc_offset($db_from, $db_to, $db_offsets, $classname); } }
/** * Assume all users are new. Add them to real db with a prefix_ */ function merge_core(GDO_Database $db_from, GDO_Database $db_to, array &$db_offsets, $prefix, $prevar) { GDO::setCurrentDB($db_to); merge_calc_offset($db_from, $db_to, $db_offsets, 'GWF_User'); merge_gids($db_from, $db_to, $db_offsets, $prefix, $prevar); merge_users($db_from, $db_to, $db_offsets, $prefix, $prevar); merge_add_offset($db_from, $db_to, 'GWF_UserGroup', 'ug_userid', $db_offsets['GWF_User']); merge_use_mapping($db_from, $db_to, 'GWF_UserGroup', 'ug_groupid', $db_offsets['GWF_Group']); merge_table($db_from, $db_to, 'GWF_UserGroup'); }
public static function onMerge(GDO_Database $db_from, GDO_Database $db_to, array &$db_offsets, $prefix, $prevar) { merge_calc_offset($db_from, $db_to, $db_offsets, 'GWF_VoteMulti'); merge_calc_offset($db_from, $db_to, $db_offsets, 'GWF_VoteScore'); // VoteMulti merge_add_offset($db_from, $db_to, 'GWF_VoteMulti', 'vm_id', $db_offsets['GWF_VoteMulti']); merge_add_offset($db_from, $db_to, 'GWF_VoteMulti', 'vm_uid', $db_offsets['GWF_User']); merge_use_mapping($db_from, $db_to, 'GWF_VoteMulti', 'vm_gid', $db_offsets['GWF_Group']); merge_table($db_from, $db_to, 'GWF_VoteMulti'); // VoteMultiOpt merge_add_offset($db_from, $db_to, 'GWF_VoteMultiOpt', 'vmo_vmid', $db_offsets['GWF_VoteMulti']); merge_table($db_from, $db_to, 'GWF_VoteMultiOpt'); // VoteMultiRow merge_add_offset($db_from, $db_to, 'GWF_VoteMultiRow', 'vmr_vmid', $db_offsets['GWF_VoteMulti']); merge_add_offset($db_from, $db_to, 'GWF_VoteMultiRow', 'vmr_uid', $db_offsets['GWF_User']); merge_table($db_from, $db_to, 'GWF_VoteMultiRow'); // VoteScore merge_add_offset($db_from, $db_to, 'GWF_VoteScore', 'vs_id', $db_offsets['GWF_VoteScore']); merge_table($db_from, $db_to, 'GWF_VoteScore'); // VoteScoreRow merge_add_offset($db_from, $db_to, 'GWF_VoteScoreRow', 'vsr_vsid', $db_offsets['GWF_VoteScore']); merge_add_offset($db_from, $db_to, 'GWF_VoteScoreRow', 'vsr_uid', $db_offsets['GWF_User']); merge_table($db_from, $db_to, 'GWF_VoteScoreRow'); }