| 1 | <?php |
| 2 | |
| 3 | declare( strict_types=1 ); |
| 4 | |
| 5 | namespace MediaWiki\Extension\ConfirmEdit\hCaptcha\Hooks; |
| 6 | |
| 7 | use MediaWiki\Config\Config; |
| 8 | use MediaWiki\ResourceLoader as RL; |
| 9 | |
| 10 | class ResourceLoaderHooks { |
| 11 | /** |
| 12 | * Passes config variables to ext.confirmEdit.hCaptcha.visualEditor ResourceLoader module. |
| 13 | * @param RL\Context $context |
| 14 | * @param Config $config |
| 15 | * @return array |
| 16 | */ |
| 17 | public static function getHCaptchaResourceLoaderConfig( |
| 18 | RL\Context $context, |
| 19 | Config $config |
| 20 | ) { |
| 21 | return [ |
| 22 | 'hCaptchaSiteKey' => $config->get( 'HCaptchaSiteKey' ), |
| 23 | 'hCaptchaScriptURL' => 'https://js.hcaptcha.com/1/api.js', |
| 24 | ]; |
| 25 | } |
| 26 | } |