public static function checkUserCreateTables($updater) { $base = dirname(__FILE__); $db = $updater->getDB(); if ($db->tableExists('cu_changes')) { $updater->output("...cu_changes table already exists.\n"); } else { require_once "{$base}/install.inc"; create_cu_changes($db); } if ($db->tableExists('cu_log')) { $updater->output("...cu_log table already exists.\n"); } else { require_once "{$base}/install.inc"; create_cu_log($db); } }
/** * tables are created in first step. there we only fill them */ private function populateCheckUserTables() { $dbw = wfGetDB(DB_MASTER); create_cu_changes($dbw, true); create_cu_log($dbw); }
<?php /* * Makes the required database changes for the CheckUser extension */ require_once dirname(__FILE__) . '/../../maintenance/commandLine.inc'; require_once dirname(__FILE__) . '/install.inc'; $db =& wfGetDB(DB_MASTER); if ($db->tableExists('cu_changes') && !isset($options['force'])) { echo "...cu_changes already exists.\n"; } else { $cutoff = isset($options['cutoff']) ? wfTimestamp(TS_MW, $options['cutoff']) : null; create_cu_changes($db, $cutoff); } if ($db->tableExists('cu_log') && !isset($options['force'])) { echo "...cu_log already exists.\n"; } else { create_cu_log($db); }
function efCheckUserSchemaUpdates() { global $wgDBtype, $wgExtNewIndexes; # Run install.inc as necessary $base = dirname(__FILE__); $db = wfGetDB(DB_MASTER); if ($db->tableExists('cu_changes')) { echo "...cu_changes already exists.\n"; } else { require_once "{$base}/install.inc"; create_cu_changes($db); } if ($db->tableExists('cu_log')) { echo "...cu_log already exists.\n"; } else { require_once "{$base}/install.inc"; create_cu_log($db); } if ($wgDBtype == 'mysql') { $wgExtNewIndexes[] = array('cu_changes', 'cuc_ip_hex_time', "{$base}/archives/patch-cu_changes_indexes.sql"); $wgExtNewIndexes[] = array('cu_changes', 'cuc_user_ip_time', "{$base}/archives/patch-cu_changes_indexes2.sql"); } return true; }