mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-28 02:00:57 +00:00
a86897f890
Bug: T249893 Change-Id: I64f7abc26bfc3e7b226340934a637a555edf754f
44 lines
924 B
PHP
44 lines
924 B
PHP
<?php
|
|
/**
|
|
* DiscussionTools API hooks
|
|
*
|
|
* @file
|
|
* @ingroup Extensions
|
|
* @license MIT
|
|
*/
|
|
|
|
namespace MediaWiki\Extension\DiscussionTools\Hooks;
|
|
|
|
use ApiModuleManager;
|
|
use ExtensionRegistry;
|
|
use MediaWiki\Api\Hook\ApiMain__moduleManagerHook;
|
|
use MediaWiki\Extension\DiscussionTools\ApiDiscussionToolsThank;
|
|
|
|
// phpcs:disable MediaWiki.NamingConventions.LowerCamelFunctionsName.FunctionName
|
|
|
|
class ApiHooks implements
|
|
ApiMain__moduleManagerHook
|
|
{
|
|
/**
|
|
* @param ApiModuleManager $moduleManager
|
|
* @return bool|void
|
|
*/
|
|
public function onApiMain__moduleManager( $moduleManager ) {
|
|
if ( ExtensionRegistry::getInstance()->isLoaded( 'Thanks' ) ) {
|
|
$moduleManager->addModule(
|
|
'discussiontoolsthank',
|
|
'action',
|
|
[
|
|
'class' => ApiDiscussionToolsThank::class,
|
|
'services' => [
|
|
'PermissionManager',
|
|
'ThanksLogStore',
|
|
'RevisionLookup',
|
|
'UserFactory',
|
|
]
|
|
]
|
|
);
|
|
}
|
|
}
|
|
}
|