Introducing a namespace for InputBox

This is a pre-patch for I5144fd6c54 to add a namespace for InputBox and
making sure that this still works, independently of what we're doing
later.

Change-Id: Iaaff18b50619f490a4437be7f4d95845c8e0eedb
This commit is contained in:
Isabelle Hurbain-Palatin 2021-12-10 19:03:35 +01:00
parent 12c42cbae0
commit cbead9bfbb
3 changed files with 24 additions and 5 deletions

View file

@ -20,9 +20,8 @@
"i18n"
]
},
"AutoloadClasses": {
"InputBoxHooks": "includes/InputBoxHooks.php",
"InputBox": "includes/InputBox.php"
"AutoloadNamespaces": {
"MediaWiki\\Extension\\InputBox\\": "includes/"
},
"ResourceModules": {
"ext.inputBox.styles": {
@ -44,7 +43,7 @@
},
"HookHandlers": {
"main": {
"class": "InputBoxHooks",
"class": "MediaWiki\\Extension\\InputBox\\InputBoxHooks",
"services": [
"MainConfig"
]

View file

@ -6,6 +6,15 @@
* @ingroup Extensions
*/
namespace MediaWiki\Extension\InputBox;
use ExtensionRegistry;
use Html;
use Parser;
use Sanitizer;
use SpecialPage;
use Xml;
/**
* InputBox class
*/

View file

@ -6,9 +6,20 @@
* @ingroup Extensions
*/
namespace MediaWiki\Extension\InputBox;
use Article;
use Config;
use MediaWiki;
use MediaWiki\Hook\MediaWikiPerformActionHook;
use MediaWiki\Hook\ParserFirstCallInitHook;
use MediaWiki\SpecialPage\Hook\SpecialPageBeforeExecuteHook;
use OutputPage;
use Parser;
use SpecialPage;
use Title;
use User;
use WebRequest;
/**
* InputBox hooks
@ -37,7 +48,7 @@ class InputBoxHooks implements
*/
public function onParserFirstCallInit( $parser ) {
// Register the hook with the parser
$parser->setHook( 'inputbox', [ 'InputBoxHooks', 'render' ] );
$parser->setHook( 'inputbox', 'MediaWiki\Extension\InputBox\InputBoxHooks::render' );
}
/**