| 1 |
<?php |
| 2 |
|
| 3 |
namespace MediaWiki\Extension\Math\HookHandlers; |
| 4 |
|
| 5 |
use MediaWiki\Installer\DatabaseUpdater; |
| 6 |
use MediaWiki\Installer\Hook\LoadExtensionSchemaUpdatesHook; |
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
class SchemaHooksHandler implements LoadExtensionSchemaUpdatesHook { |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 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 |
} |