X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Finstaller%2FDatabaseUpdater.php;h=a317822c0a806d860e48640228ad7d73ce8fecf3;hb=352d31a9244ae45acab16d3019e03bf47f48a54e;hp=b832d450ee40c8622a46dbb021aa23259551fc1a;hpb=3e88f9fa2a5a00bc1330560accf8e9d09c8be42a;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/installer/DatabaseUpdater.php b/includes/installer/DatabaseUpdater.php index b832d450ee..a317822c0a 100644 --- a/includes/installer/DatabaseUpdater.php +++ b/includes/installer/DatabaseUpdater.php @@ -83,7 +83,8 @@ abstract class DatabaseUpdater { FixDefaultJsonContentPages::class, CleanupEmptyCategories::class, AddRFCAndPMIDInterwiki::class, - PopulatePPSortKey::class + PopulatePPSortKey::class, + PopulateIpChanges::class, ]; /** @@ -987,19 +988,27 @@ abstract class DatabaseUpdater { } /** - * Purge the objectcache table + * Purge various database caches */ public function purgeCache() { global $wgLocalisationCacheConf; - # We can't guarantee that the user will be able to use TRUNCATE, - # but we know that DELETE is available to us + // We can't guarantee that the user will be able to use TRUNCATE, + // but we know that DELETE is available to us $this->output( "Purging caches..." ); + + // ObjectCache $this->db->delete( 'objectcache', '*', __METHOD__ ); + + // LocalisationCache if ( $wgLocalisationCacheConf['manualRecache'] ) { $this->rebuildLocalisationCache(); } + + // ResourceLoader: Message cache $blobStore = new MessageBlobStore(); $blobStore->clear(); + + // ResourceLoader: File-dependency cache $this->db->delete( 'module_deps', '*', __METHOD__ ); $this->output( "done.\n" ); } @@ -1190,4 +1199,25 @@ abstract class DatabaseUpdater { $wgContentHandlerUseDB = $this->holdContentHandlerUseDB; } } + + /** + * Migrate comments to the new 'comment' table + * @since 1.30 + */ + protected function migrateComments() { + global $wgCommentTableSchemaMigrationStage; + if ( $wgCommentTableSchemaMigrationStage >= MIGRATION_WRITE_NEW && + !$this->updateRowExists( 'MigrateComments' ) + ) { + $this->output( + "Migrating comments to the 'comments' table, printing progress markers. For large\n" . + "databases, you may want to hit Ctrl-C and do this manually with\n" . + "maintenance/migrateComments.php.\n" + ); + $task = $this->maintenance->runChild( 'MigrateComments', 'migrateComments.php' ); + $task->execute(); + $this->output( "done.\n" ); + } + } + }