Index: trunk/extensions/Translate/utils/MessageIndexRebuilder.php |
— | — | @@ -41,11 +41,8 @@ |
42 | 42 | self::checkAndAdd( $hugearray, $g, true ); |
43 | 43 | } |
44 | 44 | |
45 | | - $filename = TranslateUtils::cacheFile( 'translate_messageindex.cdb' ); |
46 | | - |
47 | | - $writer = CdbWriter::open( $filename ); |
48 | | - $writer->set( 'map', serialize( $hugearray ) ); |
49 | | - $writer->close(); |
| 45 | + $filename = TranslateUtils::cacheFile( 'translate_messageindex.ser' ); |
| 46 | + file_put_contents( $filename, serialize( $hugearray ) ); |
50 | 47 | } |
51 | 48 | |
52 | 49 | protected static function checkAndAdd( &$hugearray, $g, $ignore = false ) { |
Index: trunk/extensions/Translate/TranslateUtils.php |
— | — | @@ -304,18 +304,17 @@ |
305 | 305 | * @return \array or \type{false} |
306 | 306 | */ |
307 | 307 | public static function messageIndex() { |
308 | | - $filename = self::cacheFile( 'translate_messageindex.cdb' ); |
| 308 | + wfDebug( __METHOD__ . ": loading from file...\n" ); |
| 309 | + $filename = self::cacheFile( 'translate_messageindex.ser' ); |
309 | 310 | |
310 | 311 | if ( !file_exists( $filename ) ) { |
311 | 312 | MessageIndexRebuilder::execute(); |
312 | 313 | } |
313 | 314 | |
314 | 315 | if ( file_exists( $filename ) ) { |
315 | | - $reader = CdbReader::open( $filename ); |
316 | | - $keyToGroup = unserialize( $reader->get( 'map' ) ); |
| 316 | + $keyToGroup = unserialize( file_get_contents( $filename ) ); |
317 | 317 | } else { |
318 | | - $keyToGroup = false; |
319 | | - wfDebug( __METHOD__ . ": Message index missing." ); |
| 318 | + throw new MWException( 'Unable to get message index' ); |
320 | 319 | } |
321 | 320 | |
322 | 321 | self::$mi = $keyToGroup; |