MediaWiki  REL1_20
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 117 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 1047 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 1062 of file WebInstaller.php.

Output some stuff after a page is finished.

Definition at line 590 of file WebInstaller.php.

Returns:
bool

Reimplemented from Installer.

Definition at line 1077 of file WebInstaller.php.

Helper function to be called from envCheckServer()

Returns:
String

Reimplemented from Installer.

Definition at line 1097 of file WebInstaller.php.

WebInstaller::errorHandler ( errno,
errstr 
)

Temporary error handler for session start debugging.

Parameters:
$errno
$errstrstring

Definition at line 377 of file WebInstaller.php.

WebInstaller::execute ( array $  session)

Main entry point.

Parameters:
$sessionArray: initial session array
Returns:
Array: new session array

Definition at line 135 of file WebInstaller.php.

Clean up from execute()

Returns:
array

Definition at line 386 of file WebInstaller.php.

Retrieves MediaWiki language from Accept-Language HTTP header.

Returns:
string

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

WebInstaller::getDocUrl ( page) [protected]

Helper for Installer::docLink()

Parameters:
$page
Returns:
string

Reimplemented from Installer.

Definition at line 1029 of file WebInstaller.php.

Get HTML for an error box with an icon.

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

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

Get small text indented help for a preceding form field.

Parameters like wfMessage().

Parameters:
$msg
Returns:
string

Definition at line 643 of file WebInstaller.php.

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

Get HTML for an info box with an icon.

Parameters:
$textString: wikitext, get this with wfMessage()->plain()
$iconString: icon name, file in skins/common/images
$classString: additional class name to add to the wrapper div
Returns:
string

Definition at line 629 of file WebInstaller.php.

Referenced by getWarningBox().

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

Returns:
int

Definition at line 301 of file WebInstaller.php.

WebInstaller::getPageByName ( pageName)

Get a WebInstallerPage by name.

Parameters:
$pageNameString
Returns:
WebInstallerPage

Definition at line 429 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 546 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 839 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 923 of file WebInstaller.php.

WebInstaller::getSession ( name,
default = null 
)

Get a session variable.

Parameters:
$nameString
$default
Returns:
null

Definition at line 442 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 790 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 743 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 411 of file WebInstaller.php.

Get HTML for a warning box with an icon.

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

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

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

Get the next tabindex attribute value.

Returns:
int

Definition at line 463 of file WebInstaller.php.

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

Definition at line 399 of file WebInstaller.php.

WebInstaller::setSession ( name,
value 
)

Set a session variable.

Parameters:
$nameString key for the variable
$valueMixed

Definition at line 455 of file WebInstaller.php.

Initializes language-related variables.

Definition at line 470 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
$prefixString: the prefix added to variables to obtain form names
Returns:
array

Definition at line 1001 of file WebInstaller.php.

References $value, Installer\setPassword(), and Installer\setVar().

Show an error message in a box.

Parameters are like wfMessage().

Parameters:
$msg

Reimplemented from Installer.

Definition at line 364 of file WebInstaller.php.

Output a help box.

Parameters:
$msgString key for wfMessage()

Definition at line 661 of file WebInstaller.php.

Show a short informational message.

Output looks like a list.

Parameters:
$msgstring

Reimplemented from Installer.

Definition at line 673 of file WebInstaller.php.

Output an error or warning box using a Status object.

Parameters:
$statusStatus

Definition at line 977 of file WebInstaller.php.

Parameters:
$statusStatus

Reimplemented from Installer.

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

Start the PHP session.

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

Returns:
bool

Definition at line 314 of file WebInstaller.php.


Member Data Documentation

string WebInstaller::$currentPageName [protected]

Name of the page we're on.

Definition at line 110 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 88 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 76 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 one: * Add it here * Add a config-page-<name> message * Add a WebInstaller_<name> class

Definition at line 60 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 100 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 95 of file WebInstaller.php.

int WebInstaller::$tabIndex = 1 [protected]

Numeric index of the page we're on.

Definition at line 105 of file WebInstaller.php.


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