Make revdel input form more consistent with other forms:
[lhc/web/wiklou.git] / maintenance / rebuildInterwiki.php
index b3656bb..d3f3a4d 100644 (file)
@@ -2,29 +2,28 @@
 /**
  * Rebuild interwiki table using the file on meta and the language list
  * Wikimedia specific!
+ *
+ * @file
  * @todo document
- * @addtogroup Maintenance
+ * @ingroup Maintenance
+ * @ingroup Wikimedia
  */
 
 /** */
 $oldCwd = getcwd();
 
-$optionsWithArgs = array( "o" );
-include_once( "commandLine.inc" );
-include_once( "rebuildInterwiki.inc" );
+$optionsWithArgs = array( "d" );
+require_once( dirname(__FILE__) . '/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 );
+