Go to the documentation of this file.
53 parent::__construct(
'Import',
'import' );
72 $this->
namespace = $this->
getConfig()->get( 'ImportTargetNamespace' );
74 $this->
getOutput()->addModules(
'mediawiki.special.import' );
76 $this->importSources = $this->
getConfig()->get(
'ImportSources' );
77 Hooks::run(
'ImportSources', [ &$this->importSources ] );
80 if ( !
$user->isAllowedAny(
'import',
'importupload' ) ) {
84 # @todo Allow Title::getUserPermissionsErrors() to take an array
85 # @todo FIXME: Title::checkSpecialsAndNSPermissions() has a very wierd expectation of what
86 # getUserPermissionsErrors() might actually be used for, hence the 'ns-specialprotected'
89 'import',
$user,
true,
90 [
'ns-specialprotected',
'badaccess-group0',
'badaccess-groups' ]
93 'importupload',
$user,
true,
94 [
'ns-specialprotected',
'badaccess-group0',
'badaccess-groups' ]
117 $this->sourceName =
$request->getVal(
"source" );
119 $this->logcomment =
$request->getText(
'log-comment' );
120 $this->pageLinkDepth = $this->
getConfig()->get(
'ExportMaxLinkDepth' ) == 0
122 :
$request->getIntOrNull(
'pagelink-depth' );
124 $this->mapping =
$request->getVal(
'mapping' );
125 if ( $this->mapping ===
'namespace' ) {
126 $this->
namespace =
$request->getIntOrNull( 'namespace' );
127 } elseif ( $this->mapping ===
'subpage' ) {
128 $this->rootpage =
$request->getText(
'rootpage' );
130 $this->mapping =
'default';
134 if ( !
$user->matchEditToken(
$request->getVal(
'editToken' ) ) ) {
136 } elseif ( $this->sourceName ===
'upload' ) {
138 if (
$user->isAllowed(
'importupload' ) ) {
143 } elseif ( $this->sourceName ===
'interwiki' ) {
144 if ( !
$user->isAllowed(
'import' ) ) {
147 $this->interwiki = $this->fullInterwikiPrefix =
$request->getVal(
'interwiki' );
149 $hasSubprojects = array_key_exists( $this->interwiki, $this->importSources );
150 if ( !$hasSubprojects && !in_array( $this->interwiki, $this->importSources ) ) {
153 if ( $hasSubprojects ) {
154 $this->subproject =
$request->getVal(
'subproject' );
155 $this->fullInterwikiPrefix .=
':' .
$request->getVal(
'subproject' );
157 if ( $hasSubprojects &&
158 !in_array( $this->subproject, $this->importSources[$this->interwiki] )
163 $this->frompage =
$request->getText(
"frompage" );
164 $this->includeTemplates =
$request->getCheck(
'interwikiTemplates' );
166 $this->fullInterwikiPrefix,
169 $this->includeTemplates,
170 $this->pageLinkDepth );
180 "<p class=\"error\">\n$1\n</p>",
181 [
'importfailed',
$source->getWikiText() ]
185 if ( !is_null( $this->
namespace ) ) {
187 } elseif ( !is_null( $this->rootpage ) ) {
188 $statusRootPage = $importer->setTargetRootPage( $this->rootpage );
189 if ( !$statusRootPage->isGood() ) {
191 "<p class=\"error\">\n$1\n</p>",
193 'import-options-wrong',
194 $statusRootPage->getWikiText(),
195 count( $statusRootPage->getErrorsArray() )
203 $out->addWikiMsg(
"importstart" );
208 $this->fullInterwikiPrefix,
216 $importer->doImport();
217 }
catch ( Exception
$e ) {
223 # No source or XML parse error
225 "<p class=\"error\">\n$1\n</p>",
226 [
'importfailed', $exception->getMessage() ]
228 } elseif ( !
$result->isGood() ) {
231 "<p class=\"error\">\n$1\n</p>",
232 [
'importfailed',
$result->getWikiText() ]
236 $out->addWikiMsg(
'importsuccess' );
238 $out->addHTML(
'<hr />' );
243 $isSameSourceAsBefore = ( $this->sourceName ===
$sourceName );
244 $defaultNamespace = $this->
getConfig()->get(
'ImportTargetNamespace' );
248 <td class='mw-input'>" .
250 $this->
msg(
'import-mapping-default' )->
text(),
254 "mw-import-mapping-$sourceName-default",
255 ( $isSameSourceAsBefore ?
256 ( $this->mapping ===
'default' ) :
257 is_null( $defaultNamespace ) )
264 <td class='mw-input'>" .
266 $this->
msg(
'import-mapping-namespace' )->
text(),
270 "mw-import-mapping-$sourceName-namespace",
271 ( $isSameSourceAsBefore ?
272 ( $this->mapping ===
'namespace' ) :
273 !is_null( $defaultNamespace ) )
277 'selected' => ( $isSameSourceAsBefore ?
279 ( $defaultNamespace ||
'' ) ),
281 'name' =>
"namespace",
283 'id' =>
"mw-import-namespace-$sourceName",
284 'class' =>
'namespaceselector',
292 <td class='mw-input'>" .
294 $this->
msg(
'import-mapping-subpage' )->
text(),
298 "mw-import-mapping-$sourceName-subpage",
299 ( $isSameSourceAsBefore ? ( $this->mapping ===
'subpage' ) :
'' )
302 ( $isSameSourceAsBefore ? $this->rootpage :
'' ),
307 'id' =>
"mw-interwiki-rootpage-$sourceName",
316 $action = $this->
getPageTitle()->getLocalURL( [
'action' =>
'submit' ] );
319 $this->
addHelpLink(
'//meta.wikimedia.org/wiki/Special:MyLanguage/Help:Import',
true );
321 if (
$user->isAllowed(
'importupload' ) ) {
328 'enctype' =>
'multipart/form-data',
331 'id' =>
'mw-import-upload-form'
334 $this->
msg(
'importtext' )->parseAsBlock() .
339 <td class='mw-label'>" .
342 <td class='mw-input'>" .
343 Html::input(
'xmlimport',
'',
'file', [
'id' =>
'xmlimport' ] ) .
' ' .
347 <td class='mw-label'>" .
350 <td class='mw-input'>" .
352 ( $this->sourceName ===
'upload' ? $this->logcomment :
'' ),
353 [
'id' =>
'mw-import-comment',
'type' =>
'text' ] ) .
' ' .
359 <td class='mw-submit'>" .
369 if ( empty( $this->importSources ) ) {
370 $out->addWikiMsg(
'importnosources' );
374 if (
$user->isAllowed(
'import' ) && !empty( $this->importSources ) ) {
375 # Show input field for import depth only if $wgExportMaxLinkDepth > 0
377 if ( $this->
getConfig()->get(
'ExportMaxLinkDepth' ) > 0 ) {
379 <td class='mw-label'>" .
380 $this->
msg(
'export-pagelinks' )->parse() .
382 <td class='mw-input'>" .
396 'id' =>
'mw-import-interwiki-form'
399 $this->
msg(
'import-interwiki-text' )->parseAsBlock() .
405 <td class='mw-label'>" .
408 <td class='mw-input'>" .
411 [
'name' =>
'interwiki',
'id' =>
'interwiki' ]
415 $needSubprojectField =
false;
416 foreach ( $this->importSources
as $key =>
$value ) {
417 if ( is_int( $key ) ) {
419 } elseif (
$value !== $key ) {
420 $needSubprojectField =
true;
426 if ( is_array(
$value ) ) {
429 if ( $this->interwiki === $key ) {
439 if ( $needSubprojectField ) {
443 [
'name' =>
'subproject',
'id' =>
'subproject' ]
447 $subprojectsToAdd = [];
448 foreach ( $this->importSources
as $key =>
$value ) {
449 if ( is_array(
$value ) ) {
450 $subprojectsToAdd = array_merge( $subprojectsToAdd,
$value );
453 $subprojectsToAdd = array_unique( $subprojectsToAdd );
454 sort( $subprojectsToAdd );
468 <td class='mw-label'>" .
471 <td class='mw-input'>" .
472 Xml::input(
'frompage', 50, $this->frompage, [
'id' =>
'frompage' ] ) .
478 <td class='mw-input'>" .
480 $this->
msg(
'import-interwiki-history' )->
text(),
490 <td class='mw-input'>" .
492 $this->
msg(
'import-interwiki-templates' )->
text(),
493 'interwikiTemplates',
494 'interwikiTemplates',
495 $this->includeTemplates
501 <td class='mw-label'>" .
504 <td class='mw-input'>" .
506 ( $this->sourceName ===
'interwiki' ? $this->logcomment :
'' ),
507 [
'id' =>
'mw-interwiki-comment',
'type' =>
'text' ] ) .
' ' .
514 <td class='mw-submit'>" .
516 $this->
msg(
'import-interwiki-submit' )->
text(),
551 $this->mOriginalPageOutCallback =
552 $importer->setPageOutCallback( [ $this,
'reportPage' ] );
553 $this->mOriginalLogCallback =
554 $importer->setLogItemCallback( [ $this,
'reportLogItem' ] );
555 $importer->setNoticeCallback( [ $this,
'reportNotice' ] );
556 $this->mPageCount = 0;
557 $this->mIsUpload = $upload;
558 $this->mInterwiki = $interwiki;
569 $this->logTags = $tags;
583 $this->mLogItemCount++;
584 if ( is_callable( $this->mOriginalLogCallback ) ) {
585 call_user_func_array( $this->mOriginalLogCallback, func_get_args() );
598 $successCount, $pageInfo ) {
599 $args = func_get_args();
600 call_user_func_array( $this->mOriginalPageOutCallback,
$args );
603 # Invalid or non-importable title; a notice is already displayed
608 $linkRenderer = MediaWikiServices::getInstance()->getLinkRenderer();
609 if ( $successCount > 0 ) {
615 $this->
msg(
'import-revision-count' )->numParams( $successCount )->escaped() .
620 $logParams = [
'4:number:count' => $successCount ];
621 if ( $this->mIsUpload ) {
622 $detail = $this->
msg(
'import-logentry-upload-detail' )->numParams(
623 $successCount )->inContentLanguage()->text();
626 $pageTitle = $foreignTitle->getFullText();
627 $fullInterwikiPrefix = $this->mInterwiki;
628 Hooks::run(
'ImportLogInterwikiLink', [ &$fullInterwikiPrefix, &$pageTitle ] );
630 $interwikiTitleStr = $fullInterwikiPrefix .
':' . $pageTitle;
631 $interwiki =
'[[:' . $interwikiTitleStr .
']]';
632 $detail = $this->
msg(
'import-logentry-interwiki-detail' )->numParams(
633 $successCount )->params( $interwiki )->inContentLanguage()->text();
634 $action =
'interwiki';
635 $logParams[
'5:title-link:interwiki'] = $interwikiTitleStr;
638 $detail .= $this->
msg(
'colon-separator' )->inContentLanguage()->text()
644 $latest =
$title->getLatestRevID();
654 if ( !is_null( $nullRevision ) ) {
655 $nullRevId = $nullRevision->insertOn( $dbw );
658 $page->updateRevisionOn( $dbw, $nullRevision );
660 'NewRevisionFromEditComplete',
667 $logEntry->setTarget(
$title );
668 $logEntry->setComment( $this->
reason );
669 $logEntry->setPerformer( $this->
getUser() );
670 $logEntry->setParameters( $logParams );
671 $logid = $logEntry->insert();
672 if (
count( $this->logTags ) ) {
673 $logEntry->setTags( $this->logTags );
676 $logEntry->setAssociatedRevId( $nullRevId );
678 $logEntry->publish( $logid );
682 $this->
msg(
'import-nonewrevisions' )->escaped() .
"</li>\n" );
688 if ( $this->mLogItemCount > 0 ) {
689 $msg = $this->
msg(
'imported-log-entries' )->numParams( $this->mLogItemCount )->parse();
691 } elseif ( $this->mPageCount == 0 && $this->mLogItemCount == 0 ) {
692 $out->addHTML(
"</ul>\n" );
696 $out->addHTML(
"</ul>\n" );
MediaWiki page data importer.
getPageTitle( $subpage=false)
Get a self-referential title object.
XML file reader for the page data importer.
error also a ContextSource you ll probably need to make sure the header is varied on $request
wfMergeErrorArrays()
Merge arrays in the style of getUserPermissionsErrors, with duplicate removal e.g.
msg()
Get a Message object with context set Parameters are the same as wfMessage()
static tags( $element, $attribs=null, $contents)
Same as Xml::element(), but does not escape contents.
getOutput()
Get the OutputPage being used for this instance.
static label( $label, $id, $attribs=[])
Convenience function to build an HTML form label.
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add text
$mOriginalPageOutCallback
The index of the header message $result[1]=The index of the body text message $result[2 through n]=Parameters passed to body text message. Please note the header message cannot receive/use parameters. 'ImportHandleLogItemXMLTag':When parsing a XML tag in a log item. Return false to stop further processing of the tag $reader:XMLReader object $logInfo:Array of information 'ImportHandlePageXMLTag':When parsing a XML tag in a page. Return false to stop further processing of the tag $reader:XMLReader object & $pageInfo:Array of information 'ImportHandleRevisionXMLTag':When parsing a XML tag in a page revision. Return false to stop further processing of the tag $reader:XMLReader object $pageInfo:Array of page information $revisionInfo:Array of revision information 'ImportHandleToplevelXMLTag':When parsing a top level XML tag. Return false to stop further processing of the tag $reader:XMLReader object 'ImportHandleUploadXMLTag':When parsing a XML tag in a file upload. Return false to stop further processing of the tag $reader:XMLReader object $revisionInfo:Array of information 'ImportLogInterwikiLink':Hook to change the interwiki link used in log entries and edit summaries for transwiki imports. & $fullInterwikiPrefix:Interwiki prefix, may contain colons. & $pageTitle:String that contains page title. 'ImportSources':Called when reading from the $wgImportSources configuration variable. Can be used to lazy-load the import sources list. & $importSources:The value of $wgImportSources. Modify as necessary. See the comment in DefaultSettings.php for the detail of how to structure this array. 'InfoAction':When building information to display on the action=info page. $context:IContextSource object & $pageInfo:Array of information 'InitializeArticleMaybeRedirect':MediaWiki check to see if title is a redirect. & $title:Title object for the current page & $request:WebRequest & $ignoreRedirect:boolean to skip redirect check & $target:Title/string of redirect target & $article:Article object 'InternalParseBeforeLinks':during Parser 's internalParse method before links but after nowiki/noinclude/includeonly/onlyinclude and other processings. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InternalParseBeforeSanitize':during Parser 's internalParse method just before the parser removes unwanted/dangerous HTML tags and after nowiki/noinclude/includeonly/onlyinclude and other processings. Ideal for syntax-extensions after template/parser function execution which respect nowiki and HTML-comments. & $parser:Parser object & $text:string containing partially parsed text & $stripState:Parser 's internal StripState object 'InterwikiLoadPrefix':When resolving if a given prefix is an interwiki or not. Return true without providing an interwiki to continue interwiki search. $prefix:interwiki prefix we are looking for. & $iwData:output array describing the interwiki with keys iw_url, iw_local, iw_trans and optionally iw_api and iw_wikiid. 'InvalidateEmailComplete':Called after a user 's email has been invalidated successfully. $user:user(object) whose email is being invalidated 'IRCLineURL':When constructing the URL to use in an IRC notification. Callee may modify $url and $query, URL will be constructed as $url . $query & $url:URL to index.php & $query:Query string $rc:RecentChange object that triggered url generation 'IsFileCacheable':Override the result of Article::isFileCacheable()(if true) & $article:article(object) being checked 'IsTrustedProxy':Override the result of IP::isTrustedProxy() & $ip:IP being check & $result:Change this value to override the result of IP::isTrustedProxy() 'IsUploadAllowedFromUrl':Override the result of UploadFromUrl::isAllowedUrl() $url:URL used to upload from & $allowed:Boolean indicating if uploading is allowed for given URL 'isValidEmailAddr':Override the result of Sanitizer::validateEmail(), for instance to return false if the domain name doesn 't match your organization. $addr:The e-mail address entered by the user & $result:Set this and return false to override the internal checks 'isValidPassword':Override the result of User::isValidPassword() $password:The password entered by the user & $result:Set this and return false to override the internal checks $user:User the password is being validated for 'Language::getMessagesFileName':$code:The language code or the language we 're looking for a messages file for & $file:The messages file path, you can override this to change the location. 'LanguageGetMagic':DEPRECATED! Use $magicWords in a file listed in $wgExtensionMessagesFiles instead. Use this to define synonyms of magic words depending of the language & $magicExtensions:associative array of magic words synonyms $lang:language code(string) 'LanguageGetNamespaces':Provide custom ordering for namespaces or remove namespaces. Do not use this hook to add namespaces. Use CanonicalNamespaces for that. & $namespaces:Array of namespaces indexed by their numbers 'LanguageGetSpecialPageAliases':DEPRECATED! Use $specialPageAliases in a file listed in $wgExtensionMessagesFiles instead. Use to define aliases of special pages names depending of the language & $specialPageAliases:associative array of magic words synonyms $lang:language code(string) 'LanguageGetTranslatedLanguageNames':Provide translated language names. & $names:array of language code=> language name $code:language of the preferred translations 'LanguageLinks':Manipulate a page 's language links. This is called in various places to allow extensions to define the effective language links for a page. $title:The page 's Title. & $links:Array with elements of the form "language:title" in the order that they will be output. & $linkFlags:Associative array mapping prefixed links to arrays of flags. Currently unused, but planned to provide support for marking individual language links in the UI, e.g. for featured articles. 'LanguageSelector':Hook to change the language selector available on a page. $out:The output page. $cssClassName:CSS class name of the language selector. 'LinkBegin':DEPRECATED! Use HtmlPageLinkRendererBegin instead. Used when generating internal and interwiki links in Linker::link(), before processing starts. Return false to skip default processing and return $ret. See documentation for Linker::link() for details on the expected meanings of parameters. $skin:the Skin object $target:the Title that the link is pointing to & $html:the contents that the< a > tag should have(raw HTML) $result
as see the revision history and available at free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
please add to it if you re going to add events to the MediaWiki code where normally authentication against an external auth plugin would be creating a account $user
static newFatal( $message)
Factory function for fatal errors.
static option( $text, $value=null, $selected=false, $attribs=[])
Convenience function to build an HTML drop-down list item.
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing after in associative array form before processing starts Return false to skip default processing and return $ret $linkRenderer
useTransactionalTimeLimit()
Call wfTransactionalTimeLimit() if this request was POSTed.
Show an error when a user tries to do something they do not have the necessary permissions for.
getUser()
Get the User object.
static openElement( $element, $attribs=null)
This opens an XML element.
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency which acts as the top level factory for services in MediaWiki which can be used to gain access to default instances of various services MediaWikiServices however also allows new services to be defined and default services to be redefined Services are defined or redefined by providing a callback the instantiator that will return a new instance of the service When it will create an instance of MediaWikiServices and populate it with the services defined in the files listed by thereby bootstrapping the DI framework Per $wgServiceWiringFiles lists includes ServiceWiring php
static input( $name, $value='', $type='text', array $attribs=[])
Convenience function to produce an "<input>" element.
static fieldset( $legend=false, $content=false, $attribs=[])
Shortcut for creating fieldsets.
addHelpLink( $to, $overrideBaseUrl=false)
Adds help link with an icon via page indicators.
doImport()
Do the actual import.
getConfig()
Shortcut to get main config object.
namespace and then decline to actually register it file or subcat img or subcat $title
static factory(Title $title)
Create a WikiPage object of the appropriate class for the given title.
reportPage( $title, $foreignTitle, $revisionCount, $successCount, $pageInfo)
wfGetDB( $db, $groups=[], $wiki=false)
Get a Database object.
do that in ParserLimitReportFormat instead use this to modify the parameters of the image and a DIV can begin in one section and end in another Make sure your code can handle that case gracefully See the EditSectionClearerLink extension for an example zero but section is usually empty its values are the globals values before the output is cached $page
getOutput()
Get the OutputPage object.
The simplest way of implementing IContextSource is to hold a RequestContext as a member variable and ...
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return an< a > element with HTML attributes $attribs and contents $html will be returned If you return $ret will be returned and may include noclasses after processing & $attribs
getGroupName()
Under which header this special page is listed in Special:SpecialPages See messages 'specialpages-gro...
__construct( $importer, $upload, $interwiki, $reason=false)
setHeaders()
Sets headers - this should be called from the execute() method of all derived classes!
getUser()
Shortcut to get the User executing this instance.
doesWrites()
Indicates whether this special page may perform database writes.
getContext()
Gets the context this SpecialPage is executed in.
static newFromInterwiki( $interwiki, $page, $history=false, $templates=false, $pageLinkDepth=0)
static hidden( $name, $value, array $attribs=[])
Convenience function to produce an input element with type=hidden.
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException' returning false will NOT prevent logging $e
reportNotice( $msg, array $params)
static tooltipAndAccesskeyAttribs( $name, array $msgParams=[])
Returns the attributes for the tooltip and access key.
msg()
Wrapper around wfMessage that sets the current context.
static newGood( $value=null)
Factory function for good results.
static namespaceSelector(array $params=[], array $selectAttribs=[])
Build a drop-down box for selecting a namespace.
Parent class for all special pages.
getRequest()
Get the WebRequest being used for this instance.
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is and will automatically terminate your rights under this License parties who have received or from you under this License will not have their licenses terminated so long as such parties remain in full compliance You are not required to accept this since you have not signed it nothing else grants you permission to modify or distribute the Program or its derivative works These actions are prohibited by law if you do not accept this License by modifying or distributing the you indicate your acceptance of this License to do and all its terms and conditions for distributing or modifying the Program or works based on it Each time you redistribute the the recipient automatically receives a license from the original licensor to distribute or modify the Program subject to these terms and conditions You may not impose any further restrictions on the recipients exercise of the rights granted herein You are not responsible for enforcing compliance by third parties to this License as a consequence of a court judgment or allegation of patent infringement or for any other reason(not limited to patent issues)
static radioLabel( $label, $name, $value, $id, $checked=false, $attribs=[])
Convenience function to build an HTML radio button with a label.
static closeElement( $element)
Shortcut to close an XML element.
presenting them properly to the user as errors is done by the caller return true use this to change the list i e etc next in line in page history
This document is intended to provide useful advice for parties seeking to redistribute MediaWiki to end users It s targeted particularly at maintainers for Linux since it s been observed that distribution packages of MediaWiki often break We ve consistently had to recommend that users seeking support use official tarballs instead of their distribution s and this often solves whatever problem the user is having It would be nice if this could such as
setChangeTags(array $tags)
Sets change tags to apply to the import log entry and null revision.
__construct()
Constructor.
Class for creating log entries manually, to inject them into the database.
static newNullRevision( $dbw, $pageId, $summary, $minor, $user=null)
Create a new null-revision for insertion into a page's history.
static input( $name, $size=false, $value=false, $attribs=[])
Convenience function to build an HTML text input field.
checkReadOnly()
If the wiki is currently in readonly mode, throws a ReadOnlyError.
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
injection txt This is an overview of how MediaWiki makes use of dependency injection The design described here grew from the discussion of RFC T384 The term dependency this means that anything an object needs to operate should be injected from the the object itself should only know narrow no concrete implementation of the logic it relies on The requirement to inject everything typically results in an architecture that based on two main types of and essentially stateless service objects that use other service objects to operate on the value objects As of the beginning MediaWiki is only starting to use the DI approach Much of the code still relies on global state or direct resulting in a highly cyclical dependency MediaWikiServices
setTargetNamespace( $namespace)
Set a target namespace to override the defaults.
static run( $event, array $args=[], $deprecatedVersion=null)
Call hook functions defined in Hooks::register and $wgHooks.
outputHeader( $summaryMessageKey='')
Outputs a summary message on top of special pages Per default the message key is the canonical name o...
the array() calling protocol came about after MediaWiki 1.4rc1.
static newFromUpload( $fieldname="xmlimport")
static submitButton( $value, $attribs=[])
Convenience function to build an HTML submit button When $wgUseMediaWikiUIEverywhere is true it will ...
static checkLabel( $label, $name, $id, $checked=false, $attribs=[])
Convenience function to build an HTML checkbox with a label.
getMappingFormPart( $sourceName)
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out