MediaWiki  REL1_22
WebInstaller Class Reference

Class for the core installer web interface. More...

Inheritance diagram for WebInstaller:
Collaboration diagram for WebInstaller:

List of all members.

Public Member Functions

 __construct (WebRequest $request)
 Constructor.
 docLink ($linkText, $attribs, $parser)
 Extension tag hook for a documentation link.
 downloadLinkHook ($text, $attribs, $parser)
 Helper for "Download LocalSettings" link on WebInstall_Complete.
 envCheckPath ()
 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.
 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.
 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=array())
 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.
 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 Attributes

WebInstallerOutput $output
array $pageSequence
 The main sequence of page names.
WebRequest $request
 WebRequest object.
bool $showSessionWarning = false
 Flag indicating that session data may have been lost.

Protected Member Functions

 envGetDefaultServer ()
 Helper function to be called from envCheckServer()
 getDocUrl ($page)
 Helper for Installer::docLink()

Protected Attributes

string $currentPageName
 Name of the page we're on.
array $happyPages
 Array of pages which have declared that they have been submitted, have validated their input, and need no further processing.
array $otherPages
 Out of sequence pages, selectable by the user at any time.
array $phpErrors
 Captured PHP error text.
array $session
 Cached session array.
array $skippedPages
 List of "skipped" pages.
int $tabIndex = 1
 Numeric index of the page we're on.

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.

Detailed Description

Class for the core installer web interface.

Since:
1.17

Definition at line 30 of file WebInstaller.php.


Constructor & Destructor Documentation

Constructor.

Parameters:
$requestWebRequest

Definition at line 118 of file WebInstaller.php.


Member Function Documentation

WebInstaller::docLink ( linkText,
attribs,
parser 
)

Extension tag hook for a documentation link.

Parameters:
$linkText
$attribs
$parser
Returns:
string

Definition at line 1072 of file WebInstaller.php.

WebInstaller::downloadLinkHook ( text,
attribs,
parser 
)

Helper for "Download LocalSettings" link on WebInstall_Complete.

Parameters:
$text
$attribs
$parser
Returns:
String Html for download link

Definition at line 1088 of file WebInstaller.php.

Output some stuff after a page is finished.

Definition at line 611 of file WebInstaller.php.

Returns:
bool

Reimplemented from Installer.

Definition at line 1104 of file WebInstaller.php.

Helper function to be called from envCheckServer()

Returns:
String

Reimplemented from Installer.

Definition at line 1126 of file WebInstaller.php.

WebInstaller::errorHandler ( errno,
errstr 
)

Temporary error handler for session start debugging.

Parameters:
$errno
$errstrstring

Definition at line 385 of file WebInstaller.php.

WebInstaller::execute ( array session)

Main entry point.

Parameters:
array$sessioninitial session array
Returns:
Array: new session array

Definition at line 136 of file WebInstaller.php.

Clean up from execute()

Returns:
array

Definition at line 394 of file WebInstaller.php.

Retrieves MediaWiki language from Accept-Language HTTP header.

Returns:
string

Definition at line 497 of file WebInstaller.php.

Get a labelled checkbox to configure a boolean variable.

Parameters:
$paramsArray 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)
Returns:
string

Definition at line 892 of file WebInstaller.php.

WebInstaller::getDocUrl ( page) [protected]

Helper for Installer::docLink()

Parameters:
$page
Returns:
string

Reimplemented from Installer.

Definition at line 1054 of file WebInstaller.php.

Get HTML for an error box with an icon.

Parameters:
string$textwikitext, get this with wfMessage()->plain()
Returns:
string

Definition at line 626 of file WebInstaller.php.

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.

Returns:
string

Definition at line 348 of file WebInstaller.php.

Get small text indented help for a preceding form field.

Parameters like wfMessage().

Parameters:
$msg
Returns:
string

Definition at line 667 of file WebInstaller.php.

WebInstaller::getInfoBox ( text,
icon = false,
class = false 
)

Get HTML for an info box with an icon.

Parameters:
string$textwikitext, get this with wfMessage()->plain()
string$iconicon name, file in skins/common/images
string$classadditional class name to add to the wrapper div
Returns:
string

Definition at line 650 of file WebInstaller.php.

Referenced by getWarningBox().

Find the next page in sequence that hasn't been completed.

Returns:
int

Definition at line 307 of file WebInstaller.php.

WebInstaller::getPageByName ( pageName)

Get a WebInstallerPage by name.

Parameters:
$pageNameString
Returns:
WebInstallerPage

Definition at line 437 of file WebInstaller.php.

WebInstaller::getPageListItem ( pageName,
enabled,
currentPageName 
) [private]

Get a list item for the page list.

Parameters:
$pageNamestring
$enabledboolean
$currentPageNamestring
Returns:
string

Definition at line 561 of file WebInstaller.php.

Get a labelled password box to configure a variable.

Implements password hiding

Parameters:
$paramsArray 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)
Returns:
string

Definition at line 863 of file WebInstaller.php.

Get a set of labelled radio buttons.

Parameters:
$paramsArray 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)
Returns:
string

Definition at line 948 of file WebInstaller.php.

WebInstaller::getSession ( name,
default = null 
)

Get a session variable.

Parameters:
$nameString
$default
Returns:
null

Definition at line 450 of file WebInstaller.php.

Get a labelled textarea to configure a variable.

Parameters:
$paramsArray 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)
Returns:
string

Definition at line 814 of file WebInstaller.php.

WebInstaller::getTextBox ( params)

Get a labelled text box to configure a variable.

Parameters:
$paramsArray 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)
Returns:
string

Definition at line 767 of file WebInstaller.php.

WebInstaller::getUrl ( query = array())

Get a URL for submission back to the same script.

Parameters:
$queryarray
Returns:
string

Definition at line 419 of file WebInstaller.php.

Get HTML for a warning box with an icon.

Parameters:
string$textwikitext, get this with wfMessage()->plain()
Returns:
string

Definition at line 637 of file WebInstaller.php.

References getInfoBox().

WebInstaller::label ( msg,
forId,
contents,
helpData = "" 
)

Label a control by wrapping a config-input div around it and putting a label before it.

Parameters:
$msg
$forId
$contents
$helpDatastring
Returns:
string

Definition at line 726 of file WebInstaller.php.

References array(), tags(), and wfMessage().

Get the next tabindex attribute value.

Returns:
int

Definition at line 471 of file WebInstaller.php.

We're restarting the installation, reset the session, happyPages, etc.

Definition at line 407 of file WebInstaller.php.

WebInstaller::setSession ( name,
value 
)

Set a session variable.

Parameters:
string$namekey for the variable
$valueMixed

Definition at line 463 of file WebInstaller.php.

Initializes language-related variables.

Definition at line 478 of file WebInstaller.php.

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.

Parameters:
$varNamesArray
string$prefixthe prefix added to variables to obtain form names
Returns:
array

Definition at line 1026 of file WebInstaller.php.

References $name, $value, array(), as, request, Installer\setPassword(), and Installer\setVar().

Show an error message in a box.

Parameters are like wfMessage().

Parameters:
$msg

Reimplemented from Installer.

Definition at line 372 of file WebInstaller.php.

Output a help box.

Parameters:
string$msgkey for wfMessage()

Definition at line 685 of file WebInstaller.php.

Show a short informational message.

Output looks like a list.

Parameters:
$msgstring

Reimplemented from Installer.

Definition at line 697 of file WebInstaller.php.

Output an error or warning box using a Status object.

Parameters:
$statusStatus

Definition at line 1002 of file WebInstaller.php.

Parameters:
$statusStatus

Reimplemented from Installer.

Definition at line 709 of file WebInstaller.php.

WebInstaller::startPageWrapper ( currentPageName) [private]

Called by execute() before page output starts, to show a page list.

Parameters:
$currentPageNamestring

Definition at line 517 of file WebInstaller.php.

Start the PHP session.

This may be called before execute() to start the PHP session.

Returns:
bool

Definition at line 320 of file WebInstaller.php.


Member Data Documentation

string WebInstaller::$currentPageName [protected]

Name of the page we're on.

Definition at line 111 of file WebInstaller.php.

array WebInstaller::$happyPages [protected]

Array of pages which have declared that they have been submitted, have validated their input, and need no further processing.

Definition at line 89 of file WebInstaller.php.

array WebInstaller::$otherPages [protected]
Initial value:
 array(
        'Restart',
        'Readme',
        'ReleaseNotes',
        'Copying',
        'UpgradeDoc', 
    )

Out of sequence pages, selectable by the user at any time.

Definition at line 77 of file WebInstaller.php.

WebInstallerOutput WebInstaller::$output

Definition at line 34 of file WebInstaller.php.

array WebInstaller::$pageSequence
Initial value:
 array(
        'Language',
        'ExistingWiki',
        'Welcome',
        'DBConnect',
        'Upgrade',
        'DBSettings',
        'Name',
        'Options',
        'Install',
        'Complete',
    )

The main sequence of page names.

These will be displayed in turn.

To add a new installer page: * Add it to this WebInstaller::$pageSequence property * Add a "config-page-<name>" message * Add a "WebInstaller_<name>" class

Definition at line 61 of file WebInstaller.php.

array WebInstaller::$phpErrors [protected]

Captured PHP error text.

Temporary.

Definition at line 51 of file WebInstaller.php.

WebRequest WebInstaller::$request

WebRequest object.

Definition at line 40 of file WebInstaller.php.

array WebInstaller::$session [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 101 of file WebInstaller.php.

array WebInstaller::$skippedPages [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 96 of file WebInstaller.php.

int WebInstaller::$tabIndex = 1 [protected]

Numeric index of the page we're on.

Definition at line 106 of file WebInstaller.php.


The documentation for this class was generated from the following file: