MediaWiki
1.23.2
|
Class for the core installer web interface. More...
Public Member Functions | |
__construct (WebRequest $request) | |
Constructor. More... | |
docLink ( $linkText, $attribs, $parser) | |
Extension tag hook for a documentation link. More... | |
downloadLinkHook ( $text, $attribs, $parser) | |
Helper for "Download LocalSettings" link on WebInstall_Complete. More... | |
envCheckPath () | |
errorHandler ( $errno, $errstr) | |
Temporary error handler for session start debugging. More... | |
execute (array $session) | |
Main entry point. More... | |
finish () | |
Clean up from execute() More... | |
getAcceptLanguage () | |
Retrieves MediaWiki language from Accept-Language HTTP header. More... | |
getCheckBox ( $params) | |
Get a labelled checkbox to configure a boolean variable. More... | |
getErrorBox ( $text) | |
Get HTML for an error box with an icon. More... | |
getFingerprint () | |
Get a hash of data identifying this MW installation. More... | |
getHelpBox ( $msg) | |
Get small text indented help for a preceding form field. More... | |
getInfoBox ( $text, $icon=false, $class=false) | |
Get HTML for an info box with an icon. More... | |
getLowestUnhappy () | |
Find the next page in sequence that hasn't been completed. More... | |
getPageByName ( $pageName) | |
Get a WebInstallerPage by name. More... | |
getPasswordBox ( $params) | |
Get a labelled password box to configure a variable. More... | |
getRadioSet ( $params) | |
Get a set of labelled radio buttons. More... | |
getSession ( $name, $default=null) | |
Get a session variable. More... | |
getTextArea ( $params) | |
Get a labelled textarea to configure a variable. More... | |
getTextBox ( $params) | |
Get a labelled text box to configure a variable. More... | |
getUrl ( $query=array()) | |
Get a URL for submission back to the same script. More... | |
getWarningBox ( $text) | |
Get HTML for a warning box with an icon. More... | |
label ( $msg, $forId, $contents, $helpData="") | |
Label a control by wrapping a config-input div around it and putting a label before it. More... | |
nextTabIndex () | |
Get the next tabindex attribute value. More... | |
reset () | |
We're restarting the installation, reset the session, happyPages, etc. More... | |
setSession ( $name, $value) | |
Set a session variable. More... | |
setupLanguage () | |
Initializes language-related variables. More... | |
setVarsFromRequest ( $varNames, $prefix='config_') | |
Convenience function to set variables based on form data. More... | |
showError ( $msg) | |
Show an error message in a box. More... | |
showHelpBox ( $msg) | |
Output a help box. More... | |
showMessage ( $msg) | |
Show a short informational message. More... | |
showStatusBox ( $status) | |
Output an error or warning box using a Status object. More... | |
showStatusMessage (Status $status) | |
startSession () | |
Start the PHP session. More... | |
Public Member Functions inherited from Installer | |
__construct () | |
Constructor, always call this from child classes. More... | |
addInstallStep ( $callback, $findStep='BEGINNING') | |
Add an installation step following the given step. More... | |
dirIsExecutable ( $dir, $url) | |
Checks if scripts located in the given directory can be executed via the given URL. More... | |
disableLinkPopups () | |
doEnvironmentChecks () | |
Do initial checks of the PHP environment. More... | |
exportVars () | |
Exports all wg* variables stored by the installer into global scope. More... | |
findExtensions () | |
Finds extensions that follow the format /extensions/Name/Name.php, and returns an array containing the value for 'Name' for each found extension. More... | |
generateKeys () | |
Generate $wgSecretKey. More... | |
getCompiledDBs () | |
Get a list of DBs supported by current PHP setup. More... | |
getDBInstaller ( $type=false) | |
Get an instance of DatabaseInstaller for the specified DB type. More... | |
getFakePassword ( $realPassword) | |
Get a fake password for sending back to the user in HTML. More... | |
getParserOptions () | |
getVar ( $name, $default=null) | |
Get an MW configuration variable, or internal installer configuration variable. More... | |
parse ( $text, $lineStart=false) | |
Convert wikitext $text to HTML. More... | |
performInstallation ( $startCB, $endCB) | |
Actually perform the installation. More... | |
populateSiteStats (DatabaseInstaller $installer) | |
Install step which adds a row to the site_stats table with appropriate initial values. More... | |
restoreLinkPopups () | |
setParserLanguage ( $lang) | |
ParserOptions are constructed before we determined the language, so fix it. More... | |
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. More... | |
setVar ( $name, $value) | |
Set a MW configuration variable, or internal installer configuration variable. More... | |
Public Attributes | |
WebInstallerOutput | $output |
string[] | $pageSequence |
The main sequence of page names. More... | |
WebRequest | $request |
WebRequest object. More... | |
bool | $showSessionWarning = false |
Flag indicating that session data may have been lost. More... | |
Public Attributes inherited from Installer | |
array | $licenses |
License types. More... | |
array | $rightsProfiles |
User rights profiles. More... | |
const | MINIMUM_PCRE_VERSION = '7.2' |
The oldest version of PCRE we can support. More... | |
const | MINIMUM_PHP_VERSION = '5.3.2' |
Protected Member Functions | |
envGetDefaultServer () | |
getDocUrl ( $page) | |
Helper for Installer::docLink() More... | |
Protected Member Functions inherited from Installer | |
createMainpage (DatabaseInstaller $installer) | |
Insert Main Page with default content. More... | |
createSysop () | |
Create the first user account, grant it sysop and bureaucrat rights. More... | |
disableTimeLimit () | |
Disable the time limit for execution. More... | |
doGenerateKeys ( $keys) | |
Generate a secret value for variables using our CryptRand generator. More... | |
envCheckBrokenXML () | |
Some versions of libxml+PHP break < and > encoding horribly. More... | |
envCheckCache () | |
Environment check for compiled object cache types. More... | |
envCheckCtype () | |
envCheckDB () | |
Environment check for DB types. More... | |
envCheckDiff3 () | |
Search for GNU diff3. More... | |
envCheckExtension () | |
Environment check for setting the preferred PHP file extension. More... | |
envCheckGit () | |
Search for git. More... | |
envCheckGraphics () | |
Environment check for ImageMagick and GD. More... | |
envCheckJSON () | |
envCheckLibicu () | |
Check the libicu version. More... | |
envCheckMagicQuotes () | |
Environment check for magic_quotes_runtime. More... | |
envCheckMagicSybase () | |
Environment check for magic_quotes_sybase. More... | |
envCheckMbstring () | |
Environment check for mbstring.func_overload. More... | |
envCheckMemory () | |
Environment check for available memory. More... | |
envCheckModSecurity () | |
Scare user to death if they have mod_security. More... | |
envCheckPCRE () | |
Environment check for the PCRE module. More... | |
envCheckRegisterGlobals () | |
Environment check for register_globals. More... | |
envCheckSafeMode () | |
Environment check for safe_mode. More... | |
envCheckServer () | |
Environment check for the server hostname. More... | |
envCheckShellLocale () | |
Environment check for preferred locale in shell. More... | |
envCheckSuhosinMaxValueLength () | |
Checks if suhosin.get.max_value_length is set, and if so generate a warning because it decreases ResourceLoader performance. More... | |
envCheckUploadsDirectory () | |
Environment check for the permissions of the uploads directory. More... | |
envCheckXML () | |
Environment check for the XML module. More... | |
getInstallSteps (DatabaseInstaller $installer) | |
Get an array of install steps. More... | |
includeExtensions () | |
Installs the auto-detected extensions. More... | |
unicodeChar ( $c) | |
Convert a hex string representing a Unicode code point to that code point. More... | |
Protected Attributes | |
string | $currentPageName |
Name of the page we're on. More... | |
bool[] | $happyPages |
Array of pages which have declared that they have been submitted, have validated their input, and need no further processing. More... | |
string[] | $otherPages |
Out of sequence pages, selectable by the user at any time. More... | |
string[] | $phpErrors |
Captured PHP error text. More... | |
array[] | $session |
Cached session array. More... | |
bool[] | $skippedPages |
List of "skipped" pages. More... | |
int | $tabIndex = 1 |
Numeric index of the page we're on. More... | |
Protected Attributes inherited from Installer | |
array | $compiledDBs |
List of detected DBs, access using getCompiledDBs(). More... | |
array | $dbInstallers = array() |
Cached DB installer instances, access using getDBInstaller(). More... | |
array | $defaultVarNames |
MediaWiki configuration globals that will eventually be passed through to LocalSettings.php. More... | |
array | $envChecks |
A list of environment check methods called by doEnvironmentChecks(). More... | |
array | $extraInstallSteps = array() |
Extra steps for installation, for things like DatabaseInstallers to modify. More... | |
array | $internalDefaults |
Variables that are stored alongside globals, and are used for any configuration of the installation process aside from the MediaWiki configuration. More... | |
$mediaWikiAnnounceLanguages | |
Supported language codes for Mailman. More... | |
$mediaWikiAnnounceUrl | |
URL to mediawiki-announce subscription. More... | |
integer | $minMemorySize = 50 |
Minimum memory size in MB. More... | |
array | $objectCaches |
Known object cache types and the functions used to test for their existence. More... | |
ParserOptions | $parserOptions |
Cached ParserOptions, used by parse(). More... | |
Title | $parserTitle |
Cached Title, used by parse(). More... | |
array | $settings |
Private Member Functions | |
endPageWrapper () | |
Output some stuff after a page is finished. More... | |
getPageListItem ( $pageName, $enabled, $currentPageName) | |
Get a list item for the page list. More... | |
startPageWrapper ( $currentPageName) | |
Called by execute() before page output starts, to show a page list. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Installer | |
static | apacheModulePresent ( $moduleName) |
Checks for presence of an Apache module. More... | |
static | getDBTypes () |
Get a list of known DB types. More... | |
static | getExistingLocalSettings () |
Determine if LocalSettings.php exists. More... | |
static | locateExecutable ( $path, $names, $versionInfo=false) |
Search a path for any of the given executable names. More... | |
static | locateExecutableInDefaultPaths ( $names, $versionInfo=false) |
Same as locateExecutable(), but checks in getPossibleBinPaths() by default. More... | |
static | maybeGetWebserverPrimaryGroup () |
On POSIX systems return the primary group of the webserver we're running under. More... | |
static | overrideConfig () |
Override the necessary bits of the config to run an installation. More... | |
Static Protected Member Functions inherited from Installer | |
static | getPossibleBinPaths () |
Get an array of likely places we can find executables. More... | |
Static Protected Attributes inherited from Installer | |
static | $dbTypes |
Class for the core installer web interface.
Definition at line 30 of file WebInstaller.php.
WebInstaller::__construct | ( | WebRequest | $request | ) |
Constructor.
WebRequest | $request |
Definition at line 126 of file WebInstaller.php.
References $request, $wgParser, array(), global, output(), and request.
WebInstaller::docLink | ( | $linkText, | |
$attribs, | |||
$parser | |||
) |
Extension tag hook for a documentation link.
string | $linkText | |
string[] | $attribs | |
Parser | $parser | Unused |
Definition at line 1091 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 1108 of file WebInstaller.php.
References array(), Html\element(), Installer\parse(), Html\rawElement(), and wfMessage().
|
private |
Output some stuff after a page is finished.
Definition at line 630 of file WebInstaller.php.
References output().
Referenced by execute().
WebInstaller::envCheckPath | ( | ) |
Reimplemented from Installer.
Definition at line 1124 of file WebInstaller.php.
References $path, Installer\setVar(), and showError().
|
protected |
Reimplemented from Installer.
Definition at line 1149 of file WebInstaller.php.
References WebRequest\detectServer().
WebInstaller::errorHandler | ( | $errno, | |
$errstr | |||
) |
Temporary error handler for session start debugging.
int | $errno | Unused |
string | $errstr |
Definition at line 400 of file WebInstaller.php.
WebInstaller::execute | ( | array | $session | ) |
Main entry point.
array[] | $session | initial session array |
Definition at line 144 of file WebInstaller.php.
References $session, Installer\$settings, OutputPage\addHTML(), array(), as, Installer\disableTimeLimit(), endPageWrapper(), Installer\exportVars(), finish(), InstallerOverrides\getLocalSettingsGenerator(), getLowestUnhappy(), getPageByName(), getUrl(), Installer\getVar(), output(), OutputPage\redirect(), request, settings, setupLanguage(), and startPageWrapper().
WebInstaller::finish | ( | ) |
Clean up from execute()
Definition at line 409 of file WebInstaller.php.
References $happyPages, $session, Installer\$settings, $skippedPages, output(), and OutputPage\output().
Referenced by execute().
WebInstaller::getAcceptLanguage | ( | ) |
Retrieves MediaWiki language from Accept-Language HTTP header.
Definition at line 516 of file WebInstaller.php.
References as, Language\fetchLanguageNames(), and global.
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) 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 911 of file WebInstaller.php.
References $params, array(), Xml\check(), Installer\getVar(), nextTabIndex(), Installer\parse(), text, and wfMessage().
|
protected |
Helper for Installer::docLink()
string | $page |
Reimplemented from Installer.
Definition at line 1072 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 645 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 362 of file WebInstaller.php.
WebInstaller::getHelpBox | ( | $msg | ) |
Get small text indented help for a preceding form field.
Parameters like wfMessage().
$msg |
Definition at line 686 of file WebInstaller.php.
References $args, $html, Installer\parse(), and wfMessage().
Get HTML for an info box with an icon.
string | $text | Wikitext, get this with wfMessage()->plain() |
string | bool | $icon | Icon name, file in skins/common/images. Default: false |
string | bool | $class | Additional class name to add to the wrapper div. Default: false. |
Definition at line 669 of file WebInstaller.php.
References false, Html\infoBox(), Installer\parse(), and wfMessage().
Referenced by getErrorBox(), and getWarningBox().
WebInstaller::getLowestUnhappy | ( | ) |
Find the next page in sequence that hasn't been completed.
Definition at line 315 of file WebInstaller.php.
Referenced by execute().
WebInstaller::getPageByName | ( | $pageName | ) |
Get a WebInstallerPage by name.
string | $pageName |
Definition at line 453 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 580 of file WebInstaller.php.
References $currentPageName, $link, $name, $query, $s, array(), Html\element(), 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 882 of file WebInstaller.php.
References $params, array(), Installer\getFakePassword(), getTextBox(), and Installer\getVar().
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) 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 965 of file WebInstaller.php.
References $params, $s, $value, array(), as, Installer\getVar(), label(), nextTabIndex(), Installer\parse(), Xml\radio(), Xml\tags(), and wfMessage().
WebInstaller::getSession | ( | $name, | |
$default = null |
|||
) |
Get a session variable.
string | $name | |
array | $default |
Definition at line 467 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 833 of file WebInstaller.php.
References $params, array(), Installer\getVar(), label(), nextTabIndex(), and Xml\textarea().
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 786 of file WebInstaller.php.
References $params, array(), Installer\getVar(), Xml\input(), label(), and nextTabIndex().
Referenced by getPasswordBox().
WebInstaller::getUrl | ( | $query = array() | ) |
Get a URL for submission back to the same script.
string[] | $query |
Definition at line 435 of file WebInstaller.php.
References $query, request, and wfArrayToCgi().
Referenced by 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 656 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.
$msg | ||
$forId | ||
$contents | ||
string | $helpData |
Definition at line 745 of file WebInstaller.php.
References array(), Xml\tags(), and wfMessage().
Referenced by getRadioSet(), getTextArea(), and getTextBox().
WebInstaller::nextTabIndex | ( | ) |
Get the next tabindex attribute value.
Definition at line 490 of file WebInstaller.php.
Referenced by getCheckBox(), getRadioSet(), getTextArea(), and getTextBox().
WebInstaller::reset | ( | ) |
We're restarting the installation, reset the session, happyPages, etc.
Definition at line 422 of file WebInstaller.php.
WebInstaller::setSession | ( | $name, | |
$value | |||
) |
Set a session variable.
string | $name | Key for the variable |
mixed | $value |
Definition at line 481 of file WebInstaller.php.
WebInstaller::setupLanguage | ( | ) |
Initializes language-related variables.
Definition at line 497 of file WebInstaller.php.
References $wgContLang, $wgLang, Language\factory(), getAcceptLanguage(), getSession(), Installer\getVar(), global, request, 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 1043 of file WebInstaller.php.
References $name, $value, array(), as, request, Installer\setPassword(), and Installer\setVar().
WebInstaller::showError | ( | $msg | ) |
Show an error message in a box.
Parameters are like wfMessage().
$msg |
Reimplemented from Installer.
Definition at line 386 of file WebInstaller.php.
References $args, OutputPage\addHTML(), getErrorBox(), output(), and wfMessage().
Referenced by envCheckPath(), and startSession().
WebInstaller::showHelpBox | ( | $msg | ) |
Output a help box.
string | $msg | Key for wfMessage() |
Definition at line 704 of file WebInstaller.php.
References $args, $html, OutputPage\addHTML(), array(), and output().
WebInstaller::showMessage | ( | $msg | ) |
Show a short informational message.
Output looks like a list.
string | $msg |
Reimplemented from Installer.
Definition at line 716 of file WebInstaller.php.
References $args, $html, OutputPage\addHTML(), output(), Installer\parse(), and wfMessage().
WebInstaller::showStatusBox | ( | $status | ) |
Output an error or warning box using a Status object.
Status | $status |
Definition at line 1019 of file WebInstaller.php.
References OutputPage\addHTML(), getErrorBox(), getWarningBox(), and output().
WebInstaller::showStatusMessage | ( | Status | $status | ) |
Status | $status |
Reimplemented from Installer.
Definition at line 728 of file WebInstaller.php.
References $error, array(), as, Status\getErrorsArray(), and Status\getWarningsArray().
|
private |
Called by execute() before page output starts, to show a page list.
string | $currentPageName |
Definition at line 536 of file WebInstaller.php.
References $currentPageName, $s, array(), as, Html\element(), 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 329 of file WebInstaller.php.
References $e, array(), showError(), and wfIniGetBool().
|
protected |
Name of the page we're on.
Definition at line 119 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 93 of file WebInstaller.php.
Referenced by finish().
|
protected |
Out of sequence pages, selectable by the user at any time.
Definition at line 80 of file WebInstaller.php.
WebInstallerOutput WebInstaller::$output |
Definition at line 34 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 63 of file WebInstaller.php.
|
protected |
WebRequest WebInstaller::$request |
|
protected |
Cached session array.
Definition at line 46 of file WebInstaller.php.
bool WebInstaller::$showSessionWarning = false |
Flag indicating that session data may have been lost.
Definition at line 107 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 101 of file WebInstaller.php.
Referenced by finish().
|
protected |
Numeric index of the page we're on.
Definition at line 113 of file WebInstaller.php.