Debian Codegraph @

extensions/Math/src/HookHandlers/SchemaHooksHandler.php

raw symbols SCIP
1 <?php
2
3 namespace MediaWiki\Extension\Math\HookHandlers;
4
5 use MediaWiki\Installer\DatabaseUpdater;
6 use MediaWiki\Installer\Hook\LoadExtensionSchemaUpdatesHook;
7
8 /**
9 * Hook handler for schema hook
10 */
11 class SchemaHooksHandler implements LoadExtensionSchemaUpdatesHook {
12
13 /**
14 * LoadExtensionSchemaUpdates handler; set up math table on install/upgrade.
15 *
16 * @param DatabaseUpdater $updater
17 */
18 public function onLoadExtensionSchemaUpdates( $updater ) {
19 $type = $updater->getDB()->getType();
20 if ( !in_array( $type, [ 'mysql', 'sqlite', 'postgres' ], true ) ) {
21 return;
22 }
23
24 foreach ( [ 'mathoid', 'mathlatexml' ] as $mode ) {
25 $updater->dropExtensionTable( $mode );
26 }
27 }
28 }