r93514 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93513‎ | r93514 | r93515 >
Date:06:00, 30 July 2011
Author:aaron
Status:ok
Tags:
Comment:
Added some feedback and a dir sanity check
Modified paths:
  • /trunk/tools/mwmultiversion/multiversion/switchAllMediaWikis (modified) (history)

Diff [purge]

Index: trunk/tools/mwmultiversion/multiversion/switchAllMediaWikis
@@ -29,6 +29,10 @@
3030 die( "Usage: upgradeMediaWikis php-X.XX php-X.XX\n" );
3131 }
3232
 33+ if ( !file_exists( "$common/$newVersion" ) ) {
 34+ die( "The directory `$common/$newVersion` does not exist.\n" );
 35+ }
 36+
3337 $path = "$common/wikiversions.dat";
3438 $verList = array_filter( explode( "\n", file_get_contents( $path ) ) );
3539 if ( !count( $verList ) ) {
@@ -36,6 +40,7 @@
3741 }
3842
3943 $datList = "";
 44+ $count = 0;
4045 foreach ( $verList as $item ) {
4146 $items = explode( ' ', $row );
4247 # Existing values...
@@ -45,6 +50,7 @@
4651 # Update this wiki?
4752 if ( $version === $oldVersion || $oldVersion === 'all' ) {
4853 $version = $newVersion; // switch!
 54+ $count++;
4955 }
5056 if ( $extVersion !== '' ) {
5157 $datList .= "{$dbName} {$version} {$extVersion}\n";
@@ -59,6 +65,8 @@
6066 }
6167 # Rebuild wikiversions.cdb...
6268 shell_exec( "cd $common/multiversion && ./refreshWikiversionsCDB" );
 69+
 70+ echo "Re-configured $count wiki(s) from $oldVersion to $newVersion.\n";
6371 }
6472
6573 switchAllMediaWikis();

Status & tagging log