4 * Rebuild the localisation cache. Useful if you disabled automatic updates
5 * using $wgLocalisationCacheConf['manualRecache'] = true;
8 * php rebuildLocalisationCache.php [--force]
10 * Use --force to rebuild all files, even the ones that are not out of date.
13 require( dirname(__FILE__
).'/commandLine.inc' );
14 ini_set( 'memory_limit', '200M' );
16 $force = isset( $options['force'] );
18 $conf = $wgLocalisationCacheConf;
19 $conf['manualRecache'] = false; // Allow fallbacks to create CDB files
21 $conf['forceRecache'] = true;
23 $lc = new LocalisationCache_BulkLoad( $conf );
25 $codes = array_keys( Language
::getLanguageNames( true ) );
28 foreach ( $codes as $code ) {
29 if ( $force ||
$lc->isExpired( $code ) ) {
30 echo "Rebuilding $code...\n";
31 $lc->recache( $code );
35 echo "$numRebuilt languages rebuilt out of " . count( $codes ) . ".\n";
36 if ( $numRebuilt == 0 ) {
37 echo "Use --force to rebuild the caches which are still fresh.\n";