Undo previous commit. Schema changes are a no-no without permission first :-)
[lhc/web/wiklou.git] / maintenance / rebuildInterwiki.php
index 3256bdb..9a3cfd9 100644 (file)
@@ -1,25 +1,28 @@
 <?php
+/**
+ * Rebuild interwiki table using the file on meta and the language list
+ * Wikimedia specific!
+ *
+ * @file
+ * @todo document
+ * @ingroup Maintenance
+ */
 
-# Rebuild interwiki table using the file on meta and the language list
-# Wikimedia specific!
+/** */
 $oldCwd = getcwd();
 
-$optionsWithArgs = array( "o" );
+$optionsWithArgs = array( "d" );
 include_once( "commandLine.inc" );
 include_once( "rebuildInterwiki.inc" );
-
-$sql = getRebuildInterwikiSQL();
+chdir( $oldCwd );
 
 # Output
-if ( isset( $options['o'] ) ) {        
-       # To file specified with -o
-       chdir( $oldCwd );
-       $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 );
+