mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/DiscussionTools
synced 2024-11-30 19:16:39 +00:00
bf51f1f65c
Bug: T273303 Change-Id: I2d940e1944a9d7686bf7bc544a318c88c0b2afad
38 lines
1.1 KiB
PHP
38 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* DiscussionTools resource loader hooks
|
|
*
|
|
* @file
|
|
* @ingroup Extensions
|
|
* @license MIT
|
|
*/
|
|
|
|
namespace MediaWiki\Extension\DiscussionTools\Hooks;
|
|
|
|
use Config;
|
|
use MediaWiki\MediaWikiServices;
|
|
use MediaWiki\ResourceLoader\Hook\ResourceLoaderGetConfigVarsHook;
|
|
|
|
class ResourceLoaderHooks implements
|
|
ResourceLoaderGetConfigVarsHook
|
|
{
|
|
/**
|
|
* Set static (not request-specific) JS configuration variables
|
|
*
|
|
* @see https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderGetConfigVars
|
|
* @param array &$vars Array of variables to be added into the output of the startup module
|
|
* @param string $skin Current skin name to restrict config variables to a certain skin
|
|
* @param Config $config
|
|
*/
|
|
public function onResourceLoaderGetConfigVars( array &$vars, $skin, Config $config ) : void {
|
|
$dtConfig = MediaWikiServices::getInstance()->getConfigFactory()
|
|
->makeConfig( 'discussiontools' );
|
|
|
|
$vars['wgDTSchemaEditAttemptStepSamplingRate'] =
|
|
$dtConfig->get( 'DTSchemaEditAttemptStepSamplingRate' );
|
|
$vars['wgDTSchemaEditAttemptStepOversample'] =
|
|
$dtConfig->get( 'DTSchemaEditAttemptStepOversample' );
|
|
}
|
|
|
|
}
|