mediawiki-extensions-Confir.../includes/hCaptcha/Hooks/ResourceLoaderHooks.php

27 lines
606 B
PHP
Raw Normal View History

<?php
declare( strict_types=1 );
namespace MediaWiki\Extension\ConfirmEdit\hCaptcha\Hooks;
use MediaWiki\Config\Config;
use MediaWiki\ResourceLoader as RL;
class ResourceLoaderHooks {
/**
* Passes config variables to ext.confirmEdit.hCaptcha.visualEditor ResourceLoader module.
* @param RL\Context $context
* @param Config $config
* @return array
*/
public static function getHCaptchaResourceLoaderConfig(
RL\Context $context,
Config $config
) {
return [
'hCaptchaSiteKey' => $config->get( 'HCaptchaSiteKey' ),
'hCaptchaScriptURL' => $config->get( 'HCaptchaApiUrl' )
];
}
}