Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 1
CRAP
0.00% covered (danger)
0.00%
0 / 1
InstallerHooks
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 1
2
0.00% covered (danger)
0.00%
0 / 1
 onLoadExtensionSchemaUpdates
0.00% covered (danger)
0.00%
0 / 10
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2/**
3 * DiscussionTools installer hooks
4 *
5 * @file
6 * @ingroup Extensions
7 * @license MIT
8 */
9
10namespace MediaWiki\Extension\DiscussionTools\Hooks;
11
12use MediaWiki\Installer\DatabaseUpdater;
13use MediaWiki\Installer\Hook\LoadExtensionSchemaUpdatesHook;
14
15class InstallerHooks implements
16    LoadExtensionSchemaUpdatesHook
17{
18    /**
19     * Implements the LoadExtensionSchemaUpdates hook, to create database tables when
20     * update.php runs
21     *
22     * @param DatabaseUpdater $updater
23     * @return bool|void
24     */
25    public function onLoadExtensionSchemaUpdates( $updater ) {
26        $base = dirname( __DIR__ );
27        $type = $updater->getDB()->getType();
28
29        $updater->addExtensionTable(
30            'discussiontools_subscription',
31            "$base/../sql/$type/discussiontools_subscription.sql"
32        );
33        $updater->addExtensionTable(
34            'discussiontools_items',
35            "$base/../sql/$type/discussiontools_persistent.sql"
36        );
37    }
38}