public function execute() {
$dbw = $this->getDB( DB_MASTER );
+ $updater = DatabaseUpdater::newForDB( $dbw, true, $this );
+
foreach ( $this->mArgs as $arg ) {
- $files = array(
+ $files = [
$arg,
- $dbw->patchPath( $arg ),
- $dbw->patchPath( "patch-$arg.sql" ),
- );
+ $updater->patchPath( $dbw, $arg ),
+ $updater->patchPath( $dbw, "patch-$arg.sql" ),
+ ];
foreach ( $files as $file ) {
if ( file_exists( $file ) ) {
$this->output( "$file ...\n" );
}
}
-$maintClass = "PatchSql";
+$maintClass = PatchSql::class;
require_once RUN_MAINTENANCE_IF_MAIN;