42888eba0429e2b504f98ae963719ea274bf42c9
[lhc/web/wiklou.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 * @package MediaWiki
7 * @subpackage Maintenance
8 */
9
10 /** */
11 $oldCwd = getcwd();
12
13 $optionsWithArgs = array( "o" );
14 include_once( "commandLine.inc" );
15 include_once( "rebuildInterwiki.inc" );
16 chdir( $oldCwd );
17
18 $sql = getRebuildInterwikiSQL();
19
20 # Output
21 if ( isset( $options['o'] ) ) {
22 # To file specified with -o
23 $file = fopen( $options['o'], "w" );
24 fwrite( $file, $sql );
25 fclose( $file );
26 } else {
27 # To stdout
28 print $sql;
29 }
30
31 ?>