summaryrefslogtreecommitdiff
path: root/maintenance/rebuildInterwiki.php
blob: bc0a0008d7d5ce2dbd73bb3202bde63798102657 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
/**
 * Rebuild interwiki table using the file on meta and the language list
 * Wikimedia specific!
 * @todo document
 * @addtogroup Maintenance
 */

/** */
$oldCwd = getcwd();

$optionsWithArgs = array( "o" );
include_once( "commandLine.inc" );
include_once( "rebuildInterwiki.inc" );
chdir( $oldCwd );

$sql = getRebuildInterwikiSQL();

# Output
if ( isset( $options['o'] ) ) {
	# To file specified with -o
	$file = fopen( $options['o'], "w" );
	fwrite( $file, $sql );
	fclose( $file );
} else {
	# To stdout
	print $sql;
}