protected $shared = false;
/**
- * Scripts to run after database update
+ * @var string[] Scripts to run after database update
* Should be a subclass of LoggedUpdateMaintenance
*/
protected $postDatabaseUpdateMaintenance = [
- 'DeleteDefaultMessages',
- 'PopulateRevisionLength',
- 'PopulateRevisionSha1',
- 'PopulateImageSha1',
- 'FixExtLinksProtocolRelative',
- 'PopulateFilearchiveSha1',
- 'PopulateBacklinkNamespace',
- 'FixDefaultJsonContentPages'
+ DeleteDefaultMessages::class,
+ PopulateRevisionLength::class,
+ PopulateRevisionSha1::class,
+ PopulateImageSha1::class,
+ FixExtLinksProtocolRelative::class,
+ PopulateFilearchiveSha1::class,
+ PopulateBacklinkNamespace::class,
+ FixDefaultJsonContentPages::class,
+ CleanupEmptyCategories::class,
];
/**
/**
* @since 1.17
*
- * @return array
+ * @return string[]
*/
public function getPostDatabaseUpdateMaintenance() {
return $this->postDatabaseUpdateMaintenance;
public function doUpdates( $what = [ 'core', 'extensions', 'stats' ] ) {
global $wgVersion;
- $this->db->begin( __METHOD__ );
$what = array_flip( $what );
$this->skipSchema = isset( $what['noschema'] ) || $this->fileHandle !== null;
if ( isset( $what['core'] ) ) {
$this->writeSchemaUpdateFile();
$this->setAppliedUpdates( "$wgVersion-schema", $this->updatesSkipped );
}
-
- $this->db->commit( __METHOD__ );
}
/**