Index: trunk/tools/mwmultiversion/multiversion/switchAllMediaWikis |
— | — | @@ -29,6 +29,10 @@ |
30 | 30 | die( "Usage: upgradeMediaWikis php-X.XX php-X.XX\n" ); |
31 | 31 | } |
32 | 32 | |
| 33 | + if ( !file_exists( "$common/$newVersion" ) ) { |
| 34 | + die( "The directory `$common/$newVersion` does not exist.\n" ); |
| 35 | + } |
| 36 | + |
33 | 37 | $path = "$common/wikiversions.dat"; |
34 | 38 | $verList = array_filter( explode( "\n", file_get_contents( $path ) ) ); |
35 | 39 | if ( !count( $verList ) ) { |
— | — | @@ -36,6 +40,7 @@ |
37 | 41 | } |
38 | 42 | |
39 | 43 | $datList = ""; |
| 44 | + $count = 0; |
40 | 45 | foreach ( $verList as $item ) { |
41 | 46 | $items = explode( ' ', $row ); |
42 | 47 | # Existing values... |
— | — | @@ -45,6 +50,7 @@ |
46 | 51 | # Update this wiki? |
47 | 52 | if ( $version === $oldVersion || $oldVersion === 'all' ) { |
48 | 53 | $version = $newVersion; // switch! |
| 54 | + $count++; |
49 | 55 | } |
50 | 56 | if ( $extVersion !== '' ) { |
51 | 57 | $datList .= "{$dbName} {$version} {$extVersion}\n"; |
— | — | @@ -59,6 +65,8 @@ |
60 | 66 | } |
61 | 67 | # Rebuild wikiversions.cdb... |
62 | 68 | shell_exec( "cd $common/multiversion && ./refreshWikiversionsCDB" ); |
| 69 | + |
| 70 | + echo "Re-configured $count wiki(s) from $oldVersion to $newVersion.\n"; |
63 | 71 | } |
64 | 72 | |
65 | 73 | switchAllMediaWikis(); |