summaryrefslogtreecommitdiff
path: root/maintenance/rebuildInterwiki.php
blob: 19e081adbcfa5e7171d247a6cf34302a340fc978 (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
31
<?php
/**
 * Rebuild interwiki table using the file on meta and the language list
 * Wikimedia specific!
 * @todo document
 * @package MediaWiki
 * @subpackage 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;
}

?>