FixDefaultJsonContentPages::class,
CleanupEmptyCategories::class,
AddRFCAndPMIDInterwiki::class,
+ PopulatePPSortKey::class,
+ PopulateIpChanges::class,
];
/**
protected $holdContentHandlerUseDB = true;
/**
- * @param Database $db To perform updates on
+ * @param Database &$db To perform updates on
* @param bool $shared Whether to perform updates on shared tables
* @param Maintenance $maintenance Maintenance object which created us
*/
*
* @param string $table Name of the table to modify
* @param string $patch Name of the patch file to apply
- * @param string $fullpath Whether to treat $patch path as relative or not, defaults to false
+ * @param string|bool $fullpath Whether to treat $patch path as relative or not, defaults to false
* @return bool False if this was skipped because of schema changes being skipped
*/
- public function modifyTable( $table, $patch, $fullpath = false ) {
+ public function modifyTable( $table, $patch, $fullpath = false ) {
if ( !$this->doTable( $table ) ) {
return true;
}
}
/**
- * 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" );
}
$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" );
+ }
+ }
+
}