MediaWiki master
WebUpgradeTask.php
Go to the documentation of this file.
1<?php
2
4
7
11class WebUpgradeTask extends Task {
12
14 public function getName() {
15 return 'upgrade';
16 }
17
19 public function getDependencies() {
20 return [ 'HookContainer' ];
21 }
22
23 public function execute(): Status {
24 $status = $this->getConnection( ITaskContext::CONN_CREATE_TABLES );
25 if ( !$status->isOK() ) {
26 return $status;
27 }
28
30 $status->getDB(),
31 (bool)$this->getOption( 'Shared' )
32 );
33 $updater->setAutoExtensionHookContainer( $this->getHookContainer() );
34 $updater->doUpdates();
35 $updater->outputAppliedSummary();
36 $updater->purgeCache();
37 return $status;
38 }
39}
Apply database changes after updating MediaWiki.
static newForDB(IMaintainableDatabase $db, $shared=false, ?Maintenance $maintenance=null)
Base class for installer tasks.
Definition Task.php:24
getHookContainer()
Get a HookContainer suitable for calling LoadExtensionSchemaUpdates.
Definition Task.php:302
getConnection(string $type)
Connect to the database for a specified purpose.
Definition Task.php:200
TODO: remove this and run web upgrade with normal startup (T386661)
getName()
Get the symbolic name of the task.string
getDependencies()
Get a list of names or aliases of tasks that must be done prior to this task.to override string|strin...
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Definition Status.php:44
Dependency bundle and execution context for installer tasks.