Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
n/a
0 / 0
n/a
0 / 0
CRAP
n/a
0 / 0
SchemaChangesHandler
n/a
0 / 0
n/a
0 / 0
1
n/a
0 / 0
 onLoadExtensionSchemaUpdates
n/a
0 / 0
n/a
0 / 0
1
1<?php
2
3namespace MediaWiki\Extension\ApiFeatureUsage\HookHandler;
4
5use DatabaseUpdater;
6use MediaWiki\Installer\Hook\LoadExtensionSchemaUpdatesHook;
7
8class SchemaChangesHandler implements LoadExtensionSchemaUpdatesHook {
9    /**
10     * @codeCoverageIgnore This is tested by installing or updating MediaWiki
11     * @param DatabaseUpdater $updater
12     */
13    public function onLoadExtensionSchemaUpdates( $updater ) {
14        $dbType = $updater->getDB()->getType();
15        $dir = __DIR__ . "/../../schema";
16
17        $updater->addExtensionTable(
18            'api_feature_usage',
19            "$dir/$dbType/tables-generated.sql"
20        );
21    }
22}