MediaWiki REL1_31
|
Class for the core installer web interface. More...
Public Member Functions | |
__construct (WebRequest $request) | |
docLink ( $linkText, $attribs, $parser) | |
Extension tag hook for a documentation link. | |
downloadLinkHook ( $text, $attribs, $parser) | |
Helper for "Download LocalSettings" link on WebInstall_Complete. | |
envCheckPath () | |
envPrepPath () | |
Environment prep for setting $IP and $wgScriptPath. | |
errorHandler ( $errno, $errstr) | |
Temporary error handler for session start debugging. | |
execute (array $session) | |
Main entry point. | |
finish () | |
Clean up from execute() | |
getAcceptLanguage () | |
Retrieves MediaWiki language from Accept-Language HTTP header. | |
getCheckBox ( $params) | |
Get a labelled checkbox to configure a boolean variable. | |
getErrorBox ( $text) | |
Get HTML for an error box with an icon. | |
getFingerprint () | |
Get a hash of data identifying this MW installation. | |
getHelpBox ( $msg) | |
Get small text indented help for a preceding form field. | |
getInfoBox ( $text, $icon=false, $class=false) | |
Get HTML for an info box with an icon. | |
getLocalSettingsLocation () | |
If the software package wants the LocalSettings.php file to be placed in a specific location, override this function (see mw-config/overrides/README) to return the path of where the file should be saved, or false for a generic "in the base of your install". | |
getLowestUnhappy () | |
Find the next page in sequence that hasn't been completed. | |
getPageByName ( $pageName) | |
Get a WebInstallerPage by name. | |
getPasswordBox ( $params) | |
Get a labelled password box to configure a variable. | |
getPhpErrors () | |
getRadioElements ( $params) | |
Get a set of labelled radio buttons. | |
getRadioSet ( $params) | |
Get a set of labelled radio buttons. | |
getSession ( $name, $default=null) | |
Get a session variable. | |
getTextArea ( $params) | |
Get a labelled textarea to configure a variable. | |
getTextBox ( $params) | |
Get a labelled text box to configure a variable. | |
getUrl ( $query=[]) | |
Get a URL for submission back to the same script. | |
getWarningBox ( $text) | |
Get HTML for a warning box with an icon. | |
label ( $msg, $forId, $contents, $helpData="") | |
Label a control by wrapping a config-input div around it and putting a label before it. | |
nextTabIndex () | |
Get the next tabindex attribute value. | |
outputCss () | |
Output stylesheet for web installer pages. | |
reset () | |
We're restarting the installation, reset the session, happyPages, etc. | |
setSession ( $name, $value) | |
Set a session variable. | |
setupLanguage () | |
Initializes language-related variables. | |
setVarsFromRequest ( $varNames, $prefix='config_') | |
Convenience function to set variables based on form data. | |
showError ( $msg) | |
Show an error message in a box. | |
showHelpBox ( $msg) | |
Output a help box. | |
showMessage ( $msg) | |
Show a short informational message. | |
showStatusBox ( $status) | |
Output an error or warning box using a Status object. | |
showStatusMessage (Status $status) | |
startSession () | |
Start the PHP session. | |
Public Member Functions inherited from Installer | |
__construct () | |
Constructor, always call this from child classes. | |
addInstallStep ( $callback, $findStep='BEGINNING') | |
Add an installation step following the given step. | |
dirIsExecutable ( $dir, $url) | |
Checks if scripts located in the given directory can be executed via the given URL. | |
disableLinkPopups () | |
doEnvironmentChecks () | |
Do initial checks of the PHP environment. | |
doEnvironmentPreps () | |
findExtensions ( $directory='extensions') | |
Finds extensions that follow the format /$directory/Name/Name.php, and returns an array containing the value for 'Name' for each found extension. | |
generateKeys () | |
Generate $wgSecretKey. | |
getCompiledDBs () | |
Get a list of DBs supported by current PHP setup. | |
getDBInstaller ( $type=false) | |
Get an instance of DatabaseInstaller for the specified DB type. | |
getDefaultSkin (array $skinNames) | |
Returns a default value to be used for $wgDefaultSkin: normally the one set in DefaultSettings, but will fall back to another if the default skin is missing and some other one is present instead. | |
getFakePassword ( $realPassword) | |
Get a fake password for sending back to the user in HTML. | |
getParserOptions () | |
getVar ( $name, $default=null) | |
Get an MW configuration variable, or internal installer configuration variable. | |
parse ( $text, $lineStart=false) | |
Convert wikitext $text to HTML. | |
performInstallation ( $startCB, $endCB) | |
Actually perform the installation. | |
populateSiteStats (DatabaseInstaller $installer) | |
Install step which adds a row to the site_stats table with appropriate initial values. | |
restoreLinkPopups () | |
setParserLanguage ( $lang) | |
ParserOptions are constructed before we determined the language, so fix it. | |
setPassword ( $name, $value) | |
Set a variable which stores a password, except if the new value is a fake password in which case leave it as it is. | |
setVar ( $name, $value) | |
Set a MW configuration variable, or internal installer configuration variable. | |
Public Attributes | |
WebInstallerOutput | $output |
string[] | $pageSequence |
The main sequence of page names. | |
WebRequest | $request |
WebRequest object. | |
bool | $showSessionWarning = false |
Flag indicating that session data may have been lost. | |
Public Attributes inherited from Installer | |
array | $licenses |
License types. | |
array | $rightsProfiles |
User rights profiles. | |
const | MINIMUM_PCRE_VERSION = '7.2' |
The oldest version of PCRE we can support. | |
Protected Member Functions | |
envGetDefaultServer () | |
getDocUrl ( $page) | |
Helper for Installer::docLink() | |
Protected Member Functions inherited from Installer | |
createMainpage (DatabaseInstaller $installer) | |
Insert Main Page with default content. | |
createSysop () | |
Create the first user account, grant it sysop and bureaucrat rights. | |
disableTimeLimit () | |
Disable the time limit for execution. | |
doGenerateKeys ( $keys) | |
Generate a secret value for variables using our CryptRand generator. | |
envCheck64Bit () | |
Checks if we're running on 64 bit or not. | |
envCheckBrokenXML () | |
Some versions of libxml+PHP break < and > encoding horribly. | |
envCheckCache () | |
Environment check for compiled object cache types. | |
envCheckDB () | |
Environment check for DB types. | |
envCheckDiff3 () | |
Search for GNU diff3. | |
envCheckGit () | |
Search for git. | |
envCheckGraphics () | |
Environment check for ImageMagick and GD. | |
envCheckLibicu () | |
Check the libicu version. | |
envCheckMemory () | |
Environment check for available memory. | |
envCheckModSecurity () | |
Scare user to death if they have mod_security or mod_security2. | |
envCheckPCRE () | |
Environment check for the PCRE module. | |
envCheckServer () | |
Environment check to inform user which server we've assumed. | |
envCheckShellLocale () | |
Environment check for preferred locale in shell. | |
envCheckSuhosinMaxValueLength () | |
Checks if suhosin.get.max_value_length is set, and if so generate a warning because it decreases ResourceLoader performance. | |
envCheckUploadsDirectory () | |
Environment check for the permissions of the uploads directory. | |
envPrepServer () | |
Environment prep for the server hostname. | |
getInstallSteps (DatabaseInstaller $installer) | |
Get an array of install steps. | |
includeExtensions () | |
Installs the auto-detected extensions. | |
unicodeChar ( $c) | |
Convert a hex string representing a Unicode code point to that code point. | |
Protected Attributes | |
string | $currentPageName |
Name of the page we're on. | |
bool[] | $happyPages |
Array of pages which have declared that they have been submitted, have validated their input, and need no further processing. | |
string[] | $otherPages |
Out of sequence pages, selectable by the user at any time. | |
string[] | $phpErrors |
Captured PHP error text. | |
array[] | $session |
Cached session array. | |
bool[] | $skippedPages |
List of "skipped" pages. | |
int | $tabIndex = 1 |
Numeric index of the page we're on. | |
Protected Attributes inherited from Installer | |
array | $compiledDBs |
List of detected DBs, access using getCompiledDBs(). | |
array | $dbInstallers = [] |
Cached DB installer instances, access using getDBInstaller(). | |
array | $defaultVarNames |
MediaWiki configuration globals that will eventually be passed through to LocalSettings.php. | |
array | $envChecks |
A list of environment check methods called by doEnvironmentChecks(). | |
array | $envPreps |
A list of environment preparation methods called by doEnvironmentPreps(). | |
array | $extraInstallSteps = [] |
Extra steps for installation, for things like DatabaseInstallers to modify. | |
array | $internalDefaults |
Variables that are stored alongside globals, and are used for any configuration of the installation process aside from the MediaWiki configuration. | |
$mediaWikiAnnounceLanguages | |
Supported language codes for Mailman. | |
$mediaWikiAnnounceUrl | |
URL to mediawiki-announce subscription. | |
int | $minMemorySize = 50 |
Minimum memory size in MB. | |
array | $objectCaches |
Known object cache types and the functions used to test for their existence. | |
ParserOptions | $parserOptions |
Cached ParserOptions, used by parse(). | |
Title | $parserTitle |
Cached Title, used by parse(). | |
array | $settings |
Private Member Functions | |
endPageWrapper () | |
Output some stuff after a page is finished. | |
getPageListItem ( $pageName, $enabled, $currentPageName) | |
Get a list item for the page list. | |
startPageWrapper ( $currentPageName) | |
Called by execute() before page output starts, to show a page list. | |
Additional Inherited Members | |
Static Public Member Functions inherited from Installer | |
static | apacheModulePresent ( $moduleName) |
Checks for presence of an Apache module. | |
static | getDBInstallerClass ( $type) |
Get the DatabaseInstaller class name for this type. | |
static | getDBTypes () |
Get a list of known DB types. | |
static | getExistingLocalSettings () |
Determine if LocalSettings.php exists. | |
static | getInstallerConfig (Config $baseConfig) |
Constructs a Config object that contains configuration settings that should be overwritten for the installation process. | |
static | maybeGetWebserverPrimaryGroup () |
On POSIX systems return the primary group of the webserver we're running under. | |
static | overrideConfig () |
Override the necessary bits of the config to run an installation. | |
Static Protected Attributes inherited from Installer | |
static array | $dbTypes |
Known database types. | |
Class for the core installer web interface.
Definition at line 30 of file WebInstaller.php.
WebInstaller::__construct | ( | WebRequest | $request | ) |
WebRequest | $request |
Definition at line 135 of file WebInstaller.php.
WebInstaller::docLink | ( | $linkText, | |
$attribs, | |||
$parser ) |
Extension tag hook for a documentation link.
string | $linkText | |
string[] | $attribs | |
Parser | $parser | Unused |
Definition at line 1148 of file WebInstaller.php.
References $attribs, and getDocUrl().
WebInstaller::downloadLinkHook | ( | $text, | |
$attribs, | |||
$parser ) |
Helper for "Download LocalSettings" link on WebInstall_Complete.
string | $text | Unused |
string[] | $attribs | Unused |
Parser | $parser | Unused |
Definition at line 1165 of file WebInstaller.php.
References getUrl(), Installer\parse(), and wfMessage().
|
private |
Output some stuff after a page is finished.
Definition at line 649 of file WebInstaller.php.
References output().
Referenced by execute().
WebInstaller::envCheckPath | ( | ) |
Reimplemented from Installer.
Definition at line 1191 of file WebInstaller.php.
References showError().
|
protected |
WebInstaller::envPrepPath | ( | ) |
Environment prep for setting $IP and $wgScriptPath.
Reimplemented from Installer.
Definition at line 1209 of file WebInstaller.php.
References Installer\setVar().
WebInstaller::errorHandler | ( | $errno, | |
$errstr ) |
Temporary error handler for session start debugging.
int | $errno | Unused |
string | $errstr |
Definition at line 418 of file WebInstaller.php.
WebInstaller::execute | ( | array | $session | ) |
Main entry point.
array[] | $session | Initial session array |
Definition at line 153 of file WebInstaller.php.
References $GLOBALS, $session, Installer\$settings, Installer\disableTimeLimit(), endPageWrapper(), finish(), InstallerOverrides\getLocalSettingsGenerator(), getLowestUnhappy(), getPageByName(), getUrl(), Installer\getVar(), output(), outputCss(), settings, setupLanguage(), and startPageWrapper().
WebInstaller::finish | ( | ) |
Clean up from execute()
Definition at line 427 of file WebInstaller.php.
References $happyPages, $session, Installer\$settings, $skippedPages, and output().
Referenced by execute().
WebInstaller::getAcceptLanguage | ( | ) |
Retrieves MediaWiki language from Accept-Language HTTP header.
Definition at line 535 of file WebInstaller.php.
References $lang, $wgLanguageCode, and $wgRequest.
Referenced by setupLanguage().
WebInstaller::getCheckBox | ( | $params | ) |
Get a labelled checkbox to configure a boolean variable.
mixed[] | $params | Parameters are: var: The variable to be configured (required) label: The message name for the label (required) labelAttribs:Additional attributes for the label element (optional) attribs: Additional attributes for the input element (optional) controlName: The name for the input element (optional) value: The current value of the variable (optional) help: The html for the help text (optional) |
Definition at line 932 of file WebInstaller.php.
References $params, Installer\getVar(), nextTabIndex(), Installer\parse(), text, and wfMessage().
|
protected |
Helper for Installer::docLink()
string | $page |
Reimplemented from Installer.
Definition at line 1129 of file WebInstaller.php.
Referenced by docLink().
WebInstaller::getErrorBox | ( | $text | ) |
Get HTML for an error box with an icon.
string | $text | Wikitext, get this with wfMessage()->plain() |
Definition at line 664 of file WebInstaller.php.
References getInfoBox().
Referenced by showError(), and showStatusBox().
WebInstaller::getFingerprint | ( | ) |
Get a hash of data identifying this MW installation.
This is used by mw-config/index.php to prevent multiple installations of MW on the same cookie domain from interfering with each other.
Definition at line 376 of file WebInstaller.php.
References $GLOBALS, and serialize().
WebInstaller::getHelpBox | ( | $msg | ) |
Get small text indented help for a preceding form field.
Parameters like wfMessage().
string | $msg |
Definition at line 705 of file WebInstaller.php.
References $args, $html, Installer\parse(), and wfMessage().
WebInstaller::getInfoBox | ( | $text, | |
$icon = false, | |||
$class = false ) |
Get HTML for an info box with an icon.
string | $text | Wikitext, get this with wfMessage()->plain() |
string | bool | $icon | Icon name, file in mw-config/images. Default: false |
string | bool | $class | Additional class name to add to the wrapper div. Default: false. |
Definition at line 688 of file WebInstaller.php.
References false, Installer\parse(), and wfMessage().
Referenced by getErrorBox(), and getWarningBox().
WebInstaller::getLocalSettingsLocation | ( | ) |
If the software package wants the LocalSettings.php file to be placed in a specific location, override this function (see mw-config/overrides/README) to return the path of where the file should be saved, or false for a generic "in the base of your install".
Definition at line 1184 of file WebInstaller.php.
WebInstaller::getLowestUnhappy | ( | ) |
Find the next page in sequence that hasn't been completed.
Definition at line 324 of file WebInstaller.php.
Referenced by execute().
WebInstaller::getPageByName | ( | $pageName | ) |
Get a WebInstallerPage by name.
string | $pageName |
Definition at line 471 of file WebInstaller.php.
Referenced by execute().
|
private |
Get a list item for the page list.
string | $pageName | |
bool | $enabled | |
string | $currentPageName |
Definition at line 599 of file WebInstaller.php.
References $currentPageName, $link, $query, $s, getUrl(), and wfMessage().
Referenced by startPageWrapper().
WebInstaller::getPasswordBox | ( | $params | ) |
Get a labelled password box to configure a variable.
Implements password hiding
mixed[] | $params | Parameters are: var: The variable to be configured (required) label: The message name for the label (required) attribs: Additional attributes for the input element (optional) controlName: The name for the input element (optional) value: The current value of the variable (optional) help: The html for the help text (optional) |
Definition at line 902 of file WebInstaller.php.
References $params, Installer\getFakePassword(), getTextBox(), and Installer\getVar().
WebInstaller::getPhpErrors | ( | ) |
WebInstaller::getRadioElements | ( | $params | ) |
Get a set of labelled radio buttons.
You probably want to use getRadioSet(), not this.
mixed[] | $params |
Definition at line 1027 of file WebInstaller.php.
References $params, $value, Installer\getVar(), nextTabIndex(), Installer\parse(), plain, and wfMessage().
Referenced by getRadioSet().
WebInstaller::getRadioSet | ( | $params | ) |
Get a set of labelled radio buttons.
mixed[] | $params | Parameters are: var: The variable to be configured (required) label: The message name for the label (required) itemLabelPrefix: The message name prefix for the item labels (required) itemLabels: List of message names to use for the item labels instead of itemLabelPrefix, keyed by values values: List of allowed values (required) itemAttribs: Array of attribute arrays, outer key is the value name (optional) commonAttribs: Attribute array applied to all items controlName: The name for the input element (optional) value: The current value of the variable (optional) help: The html for the help text (optional) |
Definition at line 993 of file WebInstaller.php.
References $params, $s, $value, getRadioElements(), and label().
WebInstaller::getSession | ( | $name, | |
$default = null ) |
Get a session variable.
string | $name | |
array | $default |
Definition at line 485 of file WebInstaller.php.
References $name.
Referenced by setupLanguage().
WebInstaller::getTextArea | ( | $params | ) |
Get a labelled textarea to configure a variable.
mixed[] | $params | Parameters are: var: The variable to be configured (required) label: The message name for the label (required) attribs: Additional attributes for the input element (optional) controlName: The name for the input element (optional) value: The current value of the variable (optional) help: The html for the help text (optional) |
Definition at line 853 of file WebInstaller.php.
References $params, Installer\getVar(), label(), and nextTabIndex().
WebInstaller::getTextBox | ( | $params | ) |
Get a labelled text box to configure a variable.
mixed[] | $params | Parameters are: var: The variable to be configured (required) label: The message name for the label (required) attribs: Additional attributes for the input element (optional) controlName: The name for the input element (optional) value: The current value of the variable (optional) help: The html for the help text (optional) |
Definition at line 806 of file WebInstaller.php.
References $params, Installer\getVar(), label(), and nextTabIndex().
Referenced by getPasswordBox().
WebInstaller::getUrl | ( | $query = [] | ) |
Get a URL for submission back to the same script.
string[] | $query |
Definition at line 453 of file WebInstaller.php.
References $query, and wfArrayToCgi().
Referenced by downloadLinkHook(), execute(), and getPageListItem().
WebInstaller::getWarningBox | ( | $text | ) |
Get HTML for a warning box with an icon.
string | $text | Wikitext, get this with wfMessage()->plain() |
Definition at line 675 of file WebInstaller.php.
References getInfoBox().
Referenced by showStatusBox().
WebInstaller::label | ( | $msg, | |
$forId, | |||
$contents, | |||
$helpData = "" ) |
Label a control by wrapping a config-input div around it and putting a label before it.
string | $msg | |
string | $forId | |
string | $contents | |
string | $helpData |
Definition at line 765 of file WebInstaller.php.
References wfMessage().
Referenced by getRadioSet(), getTextArea(), and getTextBox().
WebInstaller::nextTabIndex | ( | ) |
Get the next tabindex attribute value.
Definition at line 508 of file WebInstaller.php.
Referenced by getCheckBox(), getRadioElements(), getTextArea(), and getTextBox().
WebInstaller::outputCss | ( | ) |
Output stylesheet for web installer pages.
Definition at line 1245 of file WebInstaller.php.
References output().
Referenced by execute().
WebInstaller::reset | ( | ) |
We're restarting the installation, reset the session, happyPages, etc.
Definition at line 440 of file WebInstaller.php.
References settings.
WebInstaller::setSession | ( | $name, | |
$value ) |
Set a session variable.
string | $name | Key for the variable |
mixed | $value |
Definition at line 499 of file WebInstaller.php.
WebInstaller::setupLanguage | ( | ) |
Initializes language-related variables.
Definition at line 515 of file WebInstaller.php.
References $wgContLang, $wgLang, $wgLanguageCode, getAcceptLanguage(), RequestContext\getMain(), getSession(), Installer\getVar(), and Installer\setVar().
Referenced by execute().
WebInstaller::setVarsFromRequest | ( | $varNames, | |
$prefix = 'config_' ) |
Convenience function to set variables based on form data.
Assumes that variables containing "password" in the name are (potentially fake) passwords.
string[] | $varNames | |
string | $prefix | The prefix added to variables to obtain form names |
Definition at line 1096 of file WebInstaller.php.
References $name, $value, Installer\setPassword(), and Installer\setVar().
WebInstaller::showError | ( | $msg | ) |
Show an error message in a box.
Parameters are like wfMessage(), or alternatively, pass a Message object in.
string | Message | $msg |
Reimplemented from Installer.
Definition at line 401 of file WebInstaller.php.
References $args, getErrorBox(), output(), and wfMessage().
Referenced by envCheckPath().
WebInstaller::showHelpBox | ( | $msg | ) |
Output a help box.
string | $msg | Key for wfMessage() |
Definition at line 724 of file WebInstaller.php.
WebInstaller::showMessage | ( | $msg | ) |
Show a short informational message.
Output looks like a list.
string | $msg |
Reimplemented from Installer.
Definition at line 736 of file WebInstaller.php.
References $args, $html, output(), Installer\parse(), plain, and wfMessage().
WebInstaller::showStatusBox | ( | $status | ) |
Output an error or warning box using a Status object.
Status | $status |
Definition at line 1072 of file WebInstaller.php.
References getErrorBox(), getWarningBox(), and output().
WebInstaller::showStatusMessage | ( | Status | $status | ) |
Status | $status |
Reimplemented from Installer.
Definition at line 748 of file WebInstaller.php.
|
private |
Called by execute() before page output starts, to show a page list.
string | $currentPageName |
Definition at line 555 of file WebInstaller.php.
References $currentPageName, $s, getPageListItem(), output(), text, and wfMessage().
Referenced by execute().
WebInstaller::startSession | ( | ) |
Start the PHP session.
This may be called before execute() to start the PHP session.
Exception |
Definition at line 338 of file WebInstaller.php.
References $e, $options, and wfIniGetBool().
|
protected |
Name of the page we're on.
Definition at line 130 of file WebInstaller.php.
Referenced by getPageListItem(), and startPageWrapper().
|
protected |
Array of pages which have declared that they have been submitted, have validated their input, and need no further processing.
Definition at line 100 of file WebInstaller.php.
Referenced by finish().
|
protected |
Out of sequence pages, selectable by the user at any time.
Definition at line 86 of file WebInstaller.php.
WebInstallerOutput WebInstaller::$output |
Definition at line 35 of file WebInstaller.php.
string [] WebInstaller::$pageSequence |
The main sequence of page names.
These will be displayed in turn.
To add a new installer page:
Definition at line 68 of file WebInstaller.php.
|
protected |
Captured PHP error text.
Temporary.
Definition at line 56 of file WebInstaller.php.
Referenced by getPhpErrors().
WebRequest WebInstaller::$request |
|
protected |
Cached session array.
Definition at line 49 of file WebInstaller.php.
bool WebInstaller::$showSessionWarning = false |
Flag indicating that session data may have been lost.
Definition at line 116 of file WebInstaller.php.
|
protected |
List of "skipped" pages.
These are pages that will automatically continue to the next page on any GET request. To avoid breaking the "back" button, they need to be skipped during a back operation.
Definition at line 109 of file WebInstaller.php.
Referenced by finish().
|
protected |
Numeric index of the page we're on.
Definition at line 123 of file WebInstaller.php.