MediaWiki  REL1_24
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.
 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=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.
 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 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.

Protected Member Functions

 envGetDefaultServer ()
 getDocUrl ($page)
 Helper for Installer::docLink()

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.

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:
WebRequest$request

Definition at line 126 of file WebInstaller.php.


Member Function Documentation

WebInstaller::docLink ( linkText,
attribs,
parser 
)

Extension tag hook for a documentation link.

Parameters:
string$linkText
string[]$attribs
Parser$parserUnused
Returns:
string

Definition at line 1116 of file WebInstaller.php.

WebInstaller::downloadLinkHook ( text,
attribs,
parser 
)

Helper for "Download LocalSettings" link on WebInstall_Complete.

Parameters:
string$textUnused
string[]$attribs Unused
Parser$parserUnused
Returns:
string Html for download link

Definition at line 1133 of file WebInstaller.php.

Output some stuff after a page is finished.

Definition at line 625 of file WebInstaller.php.

Returns:
bool

Reimplemented from Installer.

Definition at line 1145 of file WebInstaller.php.

Returns:
string

Reimplemented from Installer.

Definition at line 1180 of file WebInstaller.php.

WebInstaller::errorHandler ( errno,
errstr 
)

Temporary error handler for session start debugging.

Parameters:
int$errnoUnused
string$errstr

Definition at line 395 of file WebInstaller.php.

WebInstaller::execute ( array session)

Main entry point.

Parameters:
array[]$session Initial session array
Returns:
array[] New session array

Definition at line 144 of file WebInstaller.php.

Clean up from execute()

Returns:
array[]

Definition at line 404 of file WebInstaller.php.

Retrieves MediaWiki language from Accept-Language HTTP header.

Returns:
string

Definition at line 511 of file WebInstaller.php.

Get a labelled checkbox to configure a boolean variable.

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

Definition at line 907 of file WebInstaller.php.

WebInstaller::getDocUrl ( page) [protected]

Helper for Installer::docLink()

Parameters:
string$page
Returns:
string

Reimplemented from Installer.

Definition at line 1097 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 640 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 357 of file WebInstaller.php.

Get small text indented help for a preceding form field.

Parameters like wfMessage().

Parameters:
string$msg
Returns:
string

Definition at line 681 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 | bool$iconIcon name, file in mw-config/images. Default: false
string | bool$classAdditional class name to add to the wrapper div. Default: false.
Returns:
string

Definition at line 664 of file WebInstaller.php.

Referenced by getWarningBox().

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

Returns:
int

Definition at line 312 of file WebInstaller.php.

WebInstaller::getPageByName ( pageName)

Get a WebInstallerPage by name.

Parameters:
string$pageName
Returns:
WebInstallerPage

Definition at line 448 of file WebInstaller.php.

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

Get a list item for the page list.

Parameters:
string$pageName
bool$enabled
string$currentPageName
Returns:
string

Definition at line 575 of file WebInstaller.php.

Get a labelled password box to configure a variable.

Implements password hiding

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

Definition at line 878 of file WebInstaller.php.

Returns:
string[]

Definition at line 1195 of file WebInstaller.php.

Get a set of labelled radio buttons.

You probably want to use getRadioSet(), not this.

See also:
getRadioSet
Returns:
array

Definition at line 995 of file WebInstaller.php.

Get a set of labelled radio buttons.

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

Definition at line 962 of file WebInstaller.php.

WebInstaller::getSession ( name,
default = null 
)

Get a session variable.

Parameters:
string$name
array$default
Returns:
array

Definition at line 462 of file WebInstaller.php.

Get a labelled textarea to configure a variable.

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

Definition at line 829 of file WebInstaller.php.

WebInstaller::getTextBox ( params)

Get a labelled text box to configure a variable.

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

Definition at line 782 of file WebInstaller.php.

WebInstaller::getUrl ( query = array())

Get a URL for submission back to the same script.

Parameters:
string[]$query
Returns:
string

Definition at line 430 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 651 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:
string$msg
string$forId
string$contents
string$helpData
Returns:
string

Definition at line 741 of file WebInstaller.php.

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

Get the next tabindex attribute value.

Returns:
int

Definition at line 485 of file WebInstaller.php.

Output stylesheet for web installer pages.

Definition at line 1187 of file WebInstaller.php.

References WebRequest\detectServer().

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

Definition at line 417 of file WebInstaller.php.

WebInstaller::setSession ( name,
value 
)

Set a session variable.

Parameters:
string$nameKey for the variable
mixed$value

Definition at line 476 of file WebInstaller.php.

Initializes language-related variables.

Definition at line 492 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:
string[]$varNames
string$prefixThe prefix added to variables to obtain form names
Returns:
string[]

Definition at line 1064 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:
string$msg

Reimplemented from Installer.

Definition at line 381 of file WebInstaller.php.

Output a help box.

Parameters:
string$msgKey for wfMessage()

Definition at line 700 of file WebInstaller.php.

Show a short informational message.

Output looks like a list.

Parameters:
string$msg

Reimplemented from Installer.

Definition at line 712 of file WebInstaller.php.

Output an error or warning box using a Status object.

Parameters:
Status$status

Definition at line 1040 of file WebInstaller.php.

Parameters:
Status$status

Reimplemented from Installer.

Definition at line 724 of file WebInstaller.php.

WebInstaller::startPageWrapper ( currentPageName) [private]

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

Parameters:
string$currentPageName

Definition at line 531 of file WebInstaller.php.

Start the PHP session.

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

Exceptions:
Exception
Returns:
bool

Definition at line 326 of file WebInstaller.php.


Member Data Documentation

string WebInstaller::$currentPageName [protected]

Name of the page we're on.

Definition at line 119 of file WebInstaller.php.

bool [] 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 93 of file WebInstaller.php.

string [] 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 80 of file WebInstaller.php.

WebInstallerOutput WebInstaller::$output

Definition at line 34 of file WebInstaller.php.

string [] 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 63 of file WebInstaller.php.

string [] WebInstaller::$phpErrors [protected]

Captured PHP error text.

Temporary.

Definition at line 52 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 107 of file WebInstaller.php.

bool [] 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 101 of file WebInstaller.php.

int WebInstaller::$tabIndex = 1 [protected]

Numeric index of the page we're on.

Definition at line 113 of file WebInstaller.php.


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