Undo previous commit. Schema changes are a no-no without permission first :-)
[lhc/web/wiklou.git] / maintenance / rebuildInterwiki.php
index 19e081a..9a3cfd9 100644 (file)
@@ -2,30 +2,27 @@
 /**
  * Rebuild interwiki table using the file on meta and the language list
  * Wikimedia specific!
+ *
+ * @file
  * @todo document
- * @package MediaWiki
- * @subpackage Maintenance
+ * @ingroup Maintenance
  */
 
 /** */
 $oldCwd = getcwd();
 
-$optionsWithArgs = array( "o" );
+$optionsWithArgs = array( "d" );
 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 );
+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 );
+