summaryrefslogtreecommitdiff
blob: 2c1d94a852cfc97ededda101e875d359a17aa4c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
/**
 * Makes the required database changes for the CheckUser extension
 */

require_once ( getenv( 'MW_INSTALL_PATH' ) !== false
	? getenv( 'MW_INSTALL_PATH' ) . "/maintenance/commandLine.inc"
	: 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 );
}