/**
* Rebuild interwiki table using the file on meta and the language list
* Wikimedia specific!
+ *
+ * @file
* @todo document
- * @addtogroup Maintenance
+ * @ingroup Maintenance
*/
/** */
$oldCwd = getcwd();
-$optionsWithArgs = array( "o" );
-include_once( "commandLine.inc" );
-include_once( "rebuildInterwiki.inc" );
+$optionsWithArgs = array( "d" );
+require( "commandLine.inc" );
+require( "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 );
+if ( isset( $options['d'] ) ) {
+ $destDir = $options['d'];
} else {
- # To stdout
- print $sql;
+ $destDir = '/home/wikipedia/conf/interwiki/sql';
}
+echo "Making new interwiki SQL files in $destDir\n";
+makeInterwikiSQL( $destDir );