138 parent::__construct();
144 $wgParser->setHook(
'downloadlink', [ $this,
'downloadLinkHook' ] );
145 $wgParser->setHook(
'doclink', [ $this,
'docLink' ] );
158 if ( isset( $session[
'settings'] ) ) {
164 if ( ( $this->
getVar(
'_InstallDone' ) || $this->
getVar(
'_UpgradeDone' ) )
165 && $this->
request->getVal(
'localsettings' )
167 $this->
request->response()->header(
'Content-type: application/x-httpd-php' );
168 $this->
request->response()->header(
169 'Content-Disposition: attachment; filename="LocalSettings.php"'
173 $rightsProfile = $this->rightsProfiles[$this->
getVar(
'_RightsProfile' )];
174 foreach ( $rightsProfile
as $group => $rightsArr ) {
175 $ls->setGroupRights( $group, $rightsArr );
182 $isCSS = $this->
request->getVal(
'css' );
188 if ( isset( $session[
'happyPages'] ) ) {
189 $this->happyPages = $session[
'happyPages'];
191 $this->happyPages = [];
194 if ( isset( $session[
'skippedPages'] ) ) {
195 $this->skippedPages = $session[
'skippedPages'];
197 $this->skippedPages = [];
202 # Special case for Creative Commons partner chooser box.
203 if ( $this->
request->getVal(
'SubmitCC' ) ) {
205 $this->
output->useShortHeader();
206 $this->
output->allowFrames();
212 if ( $this->
request->getVal(
'ShowCC' ) ) {
214 $this->
output->useShortHeader();
215 $this->
output->allowFrames();
222 $pageName = $this->
request->getVal(
'page' );
224 if ( in_array( $pageName, $this->otherPages ) ) {
230 if ( !$pageName || !in_array( $pageName, $this->pageSequence ) ) {
231 $pageId = $lowestUnhappy;
233 $pageId = array_search( $pageName, $this->pageSequence );
236 # If necessary, move back to the lowest-numbered unhappy page
237 if ( $pageId > $lowestUnhappy ) {
238 $pageId = $lowestUnhappy;
239 if ( $lowestUnhappy == 0 ) {
240 # Knocked back to start, possible loss of session data.
241 $this->showSessionWarning =
true;
245 $pageName = $this->pageSequence[$pageId];
249 # If a back button was submitted, go back without submitting the form data.
250 if ( $this->
request->wasPosted() && $this->
request->getBool(
'submit-back' ) ) {
251 if ( $this->
request->getVal(
'lastPage' ) ) {
252 $nextPage = $this->
request->getVal(
'lastPage' );
253 } elseif ( $pageId !==
false ) {
255 # Skip the skipped pages
256 $nextPageId = $pageId;
260 $nextPage = $this->pageSequence[$nextPageId];
261 }
while ( isset( $this->skippedPages[$nextPage] ) );
263 $nextPage = $this->pageSequence[$lowestUnhappy];
272 $this->currentPageName =
$page->getName();
275 if (
$page->isSlow() ) {
284 # Page skipped without explicit submission.
285 # Skip it when we click "back" so that we don't just go forward again.
286 $this->skippedPages[$pageName] =
true;
289 unset( $this->skippedPages[$pageName] );
292 # If it was posted, the page can request a continue to the next page.
293 if (
$result ===
'continue' && !$this->
output->headerDone() ) {
294 if ( $pageId !==
false ) {
295 $this->happyPages[$pageId] =
true;
300 if ( $this->
request->getVal(
'lastPage' ) ) {
301 $nextPage = $this->
request->getVal(
'lastPage' );
302 } elseif ( $pageId !==
false ) {
303 $nextPage = $this->pageSequence[$pageId + 1];
305 $nextPage = $this->pageSequence[$lowestUnhappy];
308 if ( array_search( $nextPage, $this->pageSequence ) > $lowestUnhappy ) {
309 $nextPage = $this->pageSequence[$lowestUnhappy];
323 if ( count( $this->happyPages ) == 0 ) {
326 return max( array_keys( $this->happyPages ) ) + 1;
337 if (
wfIniGetBool(
'session.auto_start' ) || session_id() ) {
342 $this->phpErrors = [];
343 set_error_handler( [ $this,
'errorHandler' ] );
345 session_name(
'mw_installer_session' );
348 restore_error_handler();
351 restore_error_handler();
353 if ( $this->phpErrors ) {
370 $url = $this->
request->getFullRequestURL();
371 if ( preg_match(
'!^(.*\?)!', $url, $m ) ) {
375 if ( preg_match(
'!^(.*)/[^/]*/[^/]*$!', $url, $m ) ) {
382 'local path' => dirname( __DIR__ ),
394 if ( !( $msg instanceof
Message ) ) {
395 $args = func_get_args();
396 array_shift(
$args );
397 $args = array_map(
'htmlspecialchars',
$args );
400 $text = $msg->useDatabase(
false )->plain();
411 $this->phpErrors[] = $errstr;
434 $this->happyPages = [];
446 $url = $this->
request->getRequestURL();
447 # Remove existing query
448 $url = preg_replace(
'/\?.*$/',
'', $url );
464 $pageClass =
'WebInstaller' . $pageName;
466 return new $pageClass( $this );
478 if ( !isset( $this->session[
$name] ) ) {
481 return $this->session[
$name];
501 return $this->tabIndex++;
514 $this->
setVar(
'wgLanguageCode', $wgLanguageCode );
515 $this->
setVar(
'_UserLang', $wgLanguageCode );
517 $wgLanguageCode = $this->
getVar(
'wgLanguageCode' );
531 $headerLanguages = array_keys( $wgRequest->getAcceptLang() );
533 foreach ( $headerLanguages
as $lang ) {
534 if ( isset( $mwLanguages[$lang] ) ) {
548 $s =
"<div class=\"config-page-wrapper\">\n";
549 $s .=
"<div class=\"config-page\">\n";
550 $s .=
"<div class=\"config-page-list\"><ul>\n";
553 foreach ( $this->pageSequence
as $id => $pageName ) {
554 $happy = !empty( $this->happyPages[$id] );
557 $happy || $lastHappy == $id - 1,
566 $s .=
"</ul><br/><ul>\n";
569 $s .=
"</ul></div>\n";
579 $this->
output->addHTMLNoFlush(
$s );
592 $s =
"<li class=\"config-page-list-item\">";
599 $name =
wfMessage(
'config-page-' . strtolower( $pageName ) )->text();
602 $query = [
'page' => $pageName ];
604 if ( !in_array( $pageName, $this->pageSequence ) ) {
620 $s .=
"<span class=\"config-page-current\">$link</span>";
627 'class' =>
'config-page-disabled'
642 $this->
output->addHTMLNoFlush(
643 "<div class=\"visualClear\"></div>\n" .
645 "<div class=\"visualClear\"></div>\n" .
657 return $this->
getInfoBox( $text,
'critical-32.png',
'config-error-box' );
668 return $this->
getInfoBox( $text,
'warning-32.png',
'config-warning-box' );
680 public function getInfoBox( $text, $icon =
false, $class =
false ) {
681 $text = $this->
parse( $text,
true );
682 $icon = ( $icon ==
false ) ?
683 'images/info-32.png' :
685 $alt =
wfMessage(
'config-information' )->text();
698 $args = func_get_args();
699 array_shift(
$args );
700 $args = array_map(
'htmlspecialchars',
$args );
704 return "<div class=\"config-help-field-container\">\n" .
705 "<span class=\"config-help-field-hint\" title=\"" .
706 wfMessage(
'config-help-tooltip' )->escaped() .
"\">" .
707 wfMessage(
'config-help' )->escaped() .
"</span>\n" .
708 "<span class=\"config-help-field-data\">" .
$html .
"</span>\n" .
717 $args = func_get_args();
718 $html = call_user_func_array( [ $this,
'getHelpBox' ],
$args );
729 $args = func_get_args();
730 array_shift(
$args );
731 $html =
'<div class="config-message">' .
742 foreach ( $errors
as $error ) {
743 call_user_func_array( [ $this,
'showMessage' ], $error );
757 public function label( $msg, $forId, $contents, $helpData =
"" ) {
758 if ( strval( $msg ) ==
'' ) {
759 $labelText =
' ';
761 $labelText =
wfMessage( $msg )->escaped();
764 $attributes = [
'class' =>
'config-label' ];
767 $attributes[
'for'] = $forId;
770 return "<div class=\"config-block\">\n" .
771 " <div class=\"config-block-label\">\n" .
778 " <div class=\"config-block-elements\">\n" .
799 if ( !isset(
$params[
'controlName'] ) ) {
803 if ( !isset(
$params[
'value'] ) ) {
807 if ( !isset(
$params[
'attribs'] ) ) {
810 if ( !isset(
$params[
'help'] ) ) {
822 'id' =>
$params[
'controlName'],
823 'class' =>
'config-input-text',
846 if ( !isset(
$params[
'controlName'] ) ) {
850 if ( !isset(
$params[
'value'] ) ) {
854 if ( !isset(
$params[
'attribs'] ) ) {
857 if ( !isset(
$params[
'help'] ) ) {
870 'id' =>
$params[
'controlName'],
871 'class' =>
'config-input-text',
895 if ( !isset(
$params[
'value'] ) ) {
899 if ( !isset(
$params[
'attribs'] ) ) {
904 $params[
'attribs'][
'type'] =
'password';
924 if ( !isset(
$params[
'controlName'] ) ) {
928 if ( !isset(
$params[
'value'] ) ) {
932 if ( !isset(
$params[
'attribs'] ) ) {
935 if ( !isset(
$params[
'help'] ) ) {
938 if ( isset(
$params[
'rawtext'] ) ) {
939 $labelText =
$params[
'rawtext'];
944 return "<div class=\"config-input-check\">\n" .
951 'id' =>
$params[
'controlName'],
982 if ( !isset(
$params[
'label'] ) ) {
988 if ( !isset(
$params[
'controlName'] ) ) {
992 if ( !isset(
$params[
'help'] ) ) {
997 foreach ( $items
as $value => $item ) {
998 $s .=
"<li>$item</li>\n";
1013 if ( !isset(
$params[
'controlName'] ) ) {
1017 if ( !isset(
$params[
'value'] ) ) {
1026 if ( isset(
$params[
'commonAttribs'] ) ) {
1027 $itemAttribs =
$params[
'commonAttribs'];
1030 if ( isset(
$params[
'itemAttribs'][$value] ) ) {
1031 $itemAttribs =
$params[
'itemAttribs'][
$value] + $itemAttribs;
1034 $checked = $value ==
$params[
'value'];
1036 $itemAttribs[
'id'] = $id;
1043 isset(
$params[
'itemLabels'] ) ?
1059 $text =
$status->getWikiText();
1084 foreach ( $varNames
as $name ) {
1087 if ( stripos( $name,
'password' ) ===
false ) {
1094 $this->
setVar( $name,
false );
1096 if ( stripos( $name,
'password' ) !==
false ) {
1115 $url =
"{$_SERVER['PHP_SELF']}?page=" . urlencode(
$page );
1117 if ( in_array( $this->currentPageName, $this->pageSequence ) ) {
1118 $url .=
'&lastPage=' . urlencode( $this->currentPageName );
1136 return '<a href="' . htmlspecialchars( $url ) .
'">' .
1137 htmlspecialchars( $linkText ) .
1152 [
'href' => $this->
getUrl( [
'localsettings' => 1 ] ) ],
1156 return Html::rawElement(
'div', [
'class' =>
'config-download-link' ], $anchor );
1181 if ( !empty( $_SERVER[
'PHP_SELF'] ) ) {
1182 $path = $_SERVER[
'PHP_SELF'];
1183 } elseif ( !empty( $_SERVER[
'SCRIPT_NAME'] ) ) {
1184 $path = $_SERVER[
'SCRIPT_NAME'];
1186 if (
$path ===
false ) {
1191 return parent::envCheckPath();
1195 parent::envPrepPath();
1200 if ( !empty( $_SERVER[
'PHP_SELF'] ) ) {
1201 $path = $_SERVER[
'PHP_SELF'];
1202 } elseif ( !empty( $_SERVER[
'SCRIPT_NAME'] ) ) {
1203 $path = $_SERVER[
'SCRIPT_NAME'];
1205 if (
$path !==
false ) {
1206 $scriptPath = preg_replace(
'{^(.*)/(mw-)?config.*$}',
'$1',
$path );
1208 $this->
setVar(
'wgScriptPath',
"$scriptPath" );
1210 $this->
setVar(
'wgScript',
"$scriptPath/index.php" );
1211 $this->
setVar(
'wgLoadScript',
"$scriptPath/load.php" );
1212 $this->
setVar(
'wgStylePath',
"$scriptPath/skins" );
1213 $this->
setVar(
'wgLocalStylePath',
"$scriptPath/skins" );
1214 $this->
setVar(
'wgExtensionAssetsPath',
"$scriptPath/extensions" );
1215 $this->
setVar(
'wgUploadPath',
"$scriptPath/images" );
1216 $this->
setVar(
'wgResourceBasePath',
"$scriptPath" );
1231 $this->
request->response()->header(
'Content-type: text/css' );
1232 echo $this->
output->getCSS();
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 & $html
downloadLinkHook($text, $attribs, $parser)
Helper for "Download LocalSettings" link on WebInstall_Complete.
addHTML($text)
Append $text to the body HTML.
the array() calling protocol came about after MediaWiki 1.4rc1.
null for the local wiki Added should default to null in handler for backwards compatibility add a value to it if you want to add a cookie that have to vary cache options can modify $query
int $tabIndex
Numeric index of the page we're on.
label($msg, $forId, $contents, $helpData="")
Label a control by wrapping a config-input div around it and putting a label before it...
getCheckBox($params)
Get a labelled checkbox to configure a boolean variable.
setVar($name, $value)
Set a MW configuration variable, or internal installer configuration variable.
div flags Integer display flags(NO_ACTION_LINK, NO_EXTRA_USER_LINKS) 'LogException'returning false will NOT prevent logging $e
__construct(WebRequest $request)
Constructor.
bool[] $happyPages
Array of pages which have declared that they have been submitted, have validated their input...
static rawElement($element, $attribs=[], $contents= '')
Returns an HTML element in a string.
if(!isset($args[0])) $lang
processing should stop and the error should be shown to the user * false
getUrl($query=[])
Get a URL for submission back to the same script.
Class for the core installer web interface.
static input($name, $size=false, $value=false, $attribs=[])
Convenience function to build an HTML text input field.
getDocUrl($page)
Helper for Installer::docLink()
getRadioElements($params)
Get a set of labelled radio buttons.
static check($name, $checked=false, $attribs=[])
Convenience function to build an HTML checkbox.
getHelpBox($msg)
Get small text indented help for a preceding form field.
getFingerprint()
Get a hash of data identifying this MW installation.
WebRequest $request
WebRequest object.
when a variable name is used in a it is silently declared as a new local masking the global
static infoBox($text, $icon, $alt, $class= '')
Get HTML for an info box with an icon.
startSession()
Start the PHP session.
static getLocalSettingsGenerator(Installer $installer)
Instantiates and returns an instance of LocalSettingsGenerator or its descendant classes.
showStatusMessage(Status $status)
getWarningsArray()
Get the list of warnings (but not errors)
startPageWrapper($currentPageName)
Called by execute() before page output starts, to show a page list.
array[] $session
Cached session array.
static fetchLanguageNames($inLanguage=null, $include= 'mw')
Get an array of language names, indexed by code.
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as $wgLang
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:Associative array mapping language codes to prefixed links of the form"language:title".&$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':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
getWarningBox($text)
Get HTML for a warning box with an icon.
the value to return A Title object or null for latest to be modified or replaced by the hook handler or if authentication is not possible after cache objects are set for highlighting & $link
Output class modelled on OutputPage.
showHelpBox($msg)
Output a help box.
$wgLanguageCode
Site language code.
string[] $pageSequence
The main sequence of page names.
static detectServer()
Work out an appropriate URL prefix containing scheme and host, based on information detected from $_S...
getPasswordBox($params)
Get a labelled password box to configure a variable.
static getMain()
Static methods.
getErrorsArray()
Get the list of errors (but not warnings)
setSession($name, $value)
Set a session variable.
wfIniGetBool($setting)
Safety wrapper around ini_get() for boolean settings.
parse($text, $lineStart=false)
Convert wikitext $text to HTML.
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 externallinks including delete and has completed for all link tables whether this was an auto creation default is conds Array Extra conditions for the No matching items in log is displayed if loglist is empty msgKey Array If you want a nice box with a set this to the key of the message First element is the message additional optional elements are parameters for the key that are processed with wfMessage() -> params() ->parseAsBlock()-offset Set to overwrite offset parameter in $wgRequest set to ''to unsetoffset-wrap String Wrap the message in html(usually something like"<
getLowestUnhappy()
Find the next page in sequence that hasn't been completed.
outputCss()
Output stylesheet for web installer pages.
WebInstallerOutput $output
getLocalSettingsLocation()
If the software package wants the LocalSettings.php file to be placed in a specific location...
disableTimeLimit()
Disable the time limit for execution.
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
nextTabIndex()
Get the next tabindex attribute value.
bool[] $skippedPages
List of "skipped" pages.
globals will be eliminated from MediaWiki replaced by an application object which would be passed to constructors Whether that would be an convenient solution remains to be but certainly PHP makes such object oriented programming models easier than they were in previous versions For the time being MediaWiki programmers will have to work in an environment with some global context At the time of globals were initialised on startup by MediaWiki of these were configuration settings
showMessage($msg)
Show a short informational message.
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
errorHandler($errno, $errstr)
Temporary error handler for session start debugging.
docLink($linkText, $attribs, $parser)
Extension tag hook for a documentation link.
static radio($name, $value, $checked=false, $attribs=[])
Convenience function to build an HTML radio button.
execute(array $session)
Main entry point.
setPassword($name, $value)
Set a variable which stores a password, except if the new value is a fake password in which case leav...
getSession($name, $default=null)
Get a session variable.
getPageByName($pageName)
Get a WebInstallerPage by name.
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 tags($element, $attribs=null, $contents)
Same as Xml::element(), but does not escape contents.
string[] $phpErrors
Captured PHP error text.
getInfoBox($text, $icon=false, $class=false)
Get HTML for an info box with an icon.
showStatusBox($status)
Output an error or warning box using a Status object.
setVarsFromRequest($varNames, $prefix= 'config_')
Convenience function to set variables based on form data.
output()
Finally, all the text has been munged and accumulated into the object, let's actually output it: ...
static textarea($name, $content, $cols=40, $rows=5, $attribs=[])
Shortcut for creating textareas.
wfArrayToCgi($array1, $array2=null, $prefix= '')
This function takes one or two arrays as input, and returns a CGI-style string, e.g.
getTextBox($params)
Get a labelled text box to configure a variable.
finish()
Clean up from execute()
this class mediates it Skin Encapsulates a look and feel for the wiki All of the functions that render HTML and make choices about how to render it are here and are called from various other places when and is meant to be subclassed with other skins that may override some of its functions The User object contains a reference to a and so rather than having a global skin object we just rely on the global User and get the skin with $wgUser and also has some character encoding functions and other locale stuff The current user interface language is instantiated as and the local content language as $wgContLang
getTextArea($params)
Get a labelled textarea to configure a variable.
string[] $otherPages
Out of sequence pages, selectable by the user at any time.
this hook is for auditing only RecentChangesLinked and Watchlist RecentChangesLinked and Watchlist e g Watchlist removed from all revisions and log entries to which it was applied This gives extensions a chance to take it off their books as the deletion has already been partly carried out by this point or something similar the user will be unable to create the tag set $status
string $currentPageName
Name of the page we're on.
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 in any and then calling output() to send it all.It could be easily changed to send incrementally if that becomes useful
getAcceptLanguage()
Retrieves MediaWiki language from Accept-Language HTTP header.
reset()
We're restarting the installation, reset the session, happyPages, etc.
redirect($url, $responsecode= '302')
Redirect to $url rather than displaying the normal page.
getFakePassword($realPassword)
Get a fake password for sending back to the user in HTML.
this hook is for auditing only etc instead of letting the login form give the generic error message that the account does not exist For when the account has been renamed or deleted or an array to pass a message key and parameters create2 Corresponds to logging log_action database field and which is displayed in the UI similar to $comment this hook should only be used to add variables that depend on the current page request
static factory($code)
Get a cached or new language object for a given language code.
getVar($name, $default=null)
Get an MW configuration variable, or internal installer configuration variable.
getRadioSet($params)
Get a set of labelled radio buttons.
getErrorBox($text)
Get HTML for an error box with an icon.
getPageListItem($pageName, $enabled, $currentPageName)
Get a list item for the page list.
endPageWrapper()
Output some stuff after a page is finished.
static element($element, $attribs=[], $contents= '')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
bool $showSessionWarning
Flag indicating that session data may have been lost.
if(is_null($wgLocalTZoffset)) if(!$wgDBerrorLogTZ) $wgRequest
showError($msg)
Show an error message in a box.
setupLanguage()
Initializes language-related variables.
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
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
Allows to change the fields on the form that will be generated $name