]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blob - maintenance/rebuildInterwiki.php
MediaWiki 1.11.0
[autoinstallsdev/mediawiki.git] / maintenance / rebuildInterwiki.php
1 <?php
2 /**
3  * Rebuild interwiki table using the file on meta and the language list
4  * Wikimedia specific!
5  * @todo document
6  * @addtogroup Maintenance
7  */
8
9 /** */
10 $oldCwd = getcwd();
11
12 $optionsWithArgs = array( "o" );
13 include_once( "commandLine.inc" );
14 include_once( "rebuildInterwiki.inc" );
15 chdir( $oldCwd );
16
17 $sql = getRebuildInterwikiSQL();
18
19 # Output
20 if ( isset( $options['o'] ) ) {
21         # To file specified with -o
22         $file = fopen( $options['o'], "w" );
23         fwrite( $file, $sql );
24         fclose( $file );
25 } else {
26         # To stdout
27         print $sql;
28 }
29
30