/** * Do all the updates * * @param array $what What updates to perform */ public function doUpdates($what = ['core', 'extensions', 'stats']) { global $wgVersion; $this->db->setSchemaVars($this->getSchemaVars()); $what = array_flip($what); $this->skipSchema = isset($what['noschema']) || $this->fileHandle !== null; if (isset($what['core'])) { $this->runUpdates($this->getCoreUpdateList(), false); } if (isset($what['extensions'])) { $this->runUpdates($this->getOldGlobalUpdates(), false); $this->runUpdates($this->getExtensionUpdates(), true); } if (isset($what['stats'])) { $this->checkStats(); } $this->setAppliedUpdates($wgVersion, $this->updates); if ($this->fileHandle) { $this->skipSchema = false; $this->writeSchemaUpdateFile(); $this->setAppliedUpdates("{$wgVersion}-schema", $this->updatesSkipped); } }