PopulateFilearchiveSha1::class,
PopulateBacklinkNamespace::class,
FixDefaultJsonContentPages::class,
+ CleanupEmptyCategories::class,
];
/**
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__ );
}
/**
$this->output( "$msg ..." );
if ( !$isFullPath ) {
- $path = $this->db->patchPath( $path );
+ $path = $this->patchPath( $this->db, $path );
}
if ( $this->fileHandle !== null ) {
$this->copyFile( $path );
return true;
}
+ /**
+ * Get the full path of a patch file. Originally based on archive()
+ * from updaters.inc. Keep in mind this always returns a patch, as
+ * it fails back to MySQL if no DB-specific patch can be found
+ *
+ * @param IDatabase $db
+ * @param string $patch The name of the patch, like patch-something.sql
+ * @return string Full path to patch file
+ */
+ public function patchPath( IDatabase $db, $patch ) {
+ global $IP;
+
+ $dbType = $db->getType();
+ if ( file_exists( "$IP/maintenance/$dbType/archives/$patch" ) ) {
+ return "$IP/maintenance/$dbType/archives/$patch";
+ } else {
+ return "$IP/maintenance/archives/$patch";
+ }
+ }
+
/**
* Add a new table to the database
*
global $wgProfiler;
if ( !$this->doTable( 'profiling' ) ) {
- return true;
+ return;
}
$profileToDb = false;