MediaWiki  REL1_19
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

 $output
 $pageSequence
 $request
 $showSessionWarning = false

Protected Member Functions

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

Protected Attributes

 $currentPageName
 $happyPages
 $otherPages
 $phpErrors
 $session
 $skippedPages
 $tabIndex = 1

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 15 of file WebInstaller.php.


Constructor & Destructor Documentation

Constructor.

Parameters:
$requestWebRequest

Definition at line 113 of file WebInstaller.php.

References $request, $wgParser, and Installer\__construct().

Here is the call graph for this function:


Member Function Documentation

WebInstaller::docLink ( linkText,
attribs,
parser 
)

Extension tag hook for a documentation link.

Parameters:
$linkText
$attribs
$parser
Returns:
string

Definition at line 1041 of file WebInstaller.php.

References $url, and getDocUrl().

Here is the call graph for this function:

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 1056 of file WebInstaller.php.

References Html\element(), Html\rawElement(), and wfMsgHtml().

Here is the call graph for this function:

Output some stuff after a page is finished.

Definition at line 585 of file WebInstaller.php.

Referenced by execute().

Here is the caller graph for this function:

Returns:
bool

Reimplemented from Installer.

Definition at line 1071 of file WebInstaller.php.

References $path, Installer\setVar(), and showError().

Here is the call graph for this function:

Helper function to be called from envCheckServer()

Returns:
String

Reimplemented from Installer.

Definition at line 1091 of file WebInstaller.php.

References WebRequest\detectServer().

Here is the call graph for this function:

WebInstaller::errorHandler ( errno,
errstr 
)

Temporary error handler for session start debugging.

Parameters:
$errno
$errstrstring

Definition at line 373 of file WebInstaller.php.

WebInstaller::execute ( array $  session)

Main entry point.

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

Definition at line 131 of file WebInstaller.php.

References $page, $result, $session, Installer\disableTimeLimit(), echo, endPageWrapper(), Installer\exportVars(), finish(), getLowestUnhappy(), getPageByName(), getUrl(), Installer\getVar(), setupLanguage(), and startPageWrapper().

Here is the call graph for this function:

Clean up from execute()

Returns:
array

Definition at line 382 of file WebInstaller.php.

Referenced by execute().

Here is the caller graph for this function:

Retrieves MediaWiki language from Accept-Language HTTP header.

Returns:
string

Definition at line 484 of file WebInstaller.php.

References $wgLanguageCode, and Language\getLanguageNames().

Referenced by setupLanguage().

Here is the call graph for this function:

Here is the caller graph for this function:

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 862 of file WebInstaller.php.

References Xml\check(), Installer\getVar(), nextTabIndex(), Installer\parse(), and wfMsg().

Here is the call graph for this function:

WebInstaller::getDocUrl ( page) [protected]

Helper for Installer::docLink()

Parameters:
$page
Returns:
string

Reimplemented from Installer.

Definition at line 1023 of file WebInstaller.php.

References $page, and $url.

Referenced by docLink().

Here is the caller graph for this function:

Get HTML for an error box with an icon.

Parameters:
$textString: wikitext, get this with wfMsgNoTrans()
Returns:
string

Definition at line 600 of file WebInstaller.php.

References getInfoBox().

Referenced by showError(), and showStatusBox().

Here is the call graph for this function:

Here is the caller graph for this function:

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 337 of file WebInstaller.php.

References $url.

Get small text indented help for a preceding form field.

Parameters like wfMsg().

Parameters:
$msg
Returns:
string

Definition at line 638 of file WebInstaller.php.

References Installer\parse(), wfMsgHtml(), and wfMsgReal().

Here is the call graph for this function:

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

Get HTML for an info box with an icon.

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

Definition at line 624 of file WebInstaller.php.

References false, Html\infoBox(), Installer\parse(), and wfMsg().

Referenced by getErrorBox(), and getWarningBox().

Here is the call graph for this function:

Here is the caller graph for this function:

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

Returns:
int

Definition at line 297 of file WebInstaller.php.

Referenced by execute().

Here is the caller graph for this function:

WebInstaller::getPageByName ( pageName)

Get a WebInstallerPage by name.

Parameters:
$pageNameString
Returns:
WebInstallerPage

Definition at line 425 of file WebInstaller.php.

Referenced by execute().

Here is the caller graph for this function:

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

Get a list item for the page list.

Parameters:
$pageNameString
$enabledBoolean
$currentPageNameString
Returns:
string

Definition at line 541 of file WebInstaller.php.

References $currentPageName, Html\element(), getUrl(), and wfMsg().

Referenced by startPageWrapper().

Here is the call graph for this function:

Here is the caller graph for this function:

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 833 of file WebInstaller.php.

References Installer\getFakePassword(), getTextBox(), and Installer\getVar().

Here is the call graph for this function:

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 917 of file WebInstaller.php.

References Installer\getVar(), label(), nextTabIndex(), Installer\parse(), Xml\radio(), Xml\tags(), and wfMsgNoTrans().

Here is the call graph for this function:

WebInstaller::getSession ( name,
default = null 
)

Get a session variable.

Parameters:
$nameString
$default

Definition at line 437 of file WebInstaller.php.

Referenced by setupLanguage().

Here is the caller graph for this function:

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 784 of file WebInstaller.php.

References Installer\getVar(), label(), nextTabIndex(), and Xml\textarea().

Here is the call graph for this function:

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 737 of file WebInstaller.php.

References Installer\getVar(), Xml\input(), label(), and nextTabIndex().

Referenced by getPasswordBox().

Here is the call graph for this function:

Here is the caller graph for this function:

WebInstaller::getUrl ( query = array())

Get a URL for submission back to the same script.

Parameters:
$queryarray
Returns:
string

Definition at line 407 of file WebInstaller.php.

References $url, and wfArrayToCGI().

Referenced by execute(), and getPageListItem().

Here is the call graph for this function:

Here is the caller graph for this function:

Get HTML for a warning box with an icon.

Parameters:
$textString: wikitext, get this with wfMsgNoTrans()
Returns:
string

Definition at line 611 of file WebInstaller.php.

References getInfoBox().

Referenced by showStatusBox().

Here is the call graph for this function:

Here is the caller graph for this function:

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 696 of file WebInstaller.php.

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

Referenced by getRadioSet(), getTextArea(), and getTextBox().

Here is the call graph for this function:

Here is the caller graph for this function:

Get the next tabindex attribute value.

Returns:
int

Definition at line 458 of file WebInstaller.php.

Referenced by getCheckBox(), getRadioSet(), getTextArea(), and getTextBox().

Here is the caller graph for this function:

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

Definition at line 395 of file WebInstaller.php.

WebInstaller::setSession ( name,
value 
)

Set a session variable.

Parameters:
$nameString key for the variable
$valueMixed

Definition at line 450 of file WebInstaller.php.

Initializes language-related variables.

Definition at line 465 of file WebInstaller.php.

References $wgContLang, $wgLang, $wgLanguageCode, Language\factory(), getAcceptLanguage(), getSession(), Installer\getVar(), and Installer\setVar().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

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 995 of file WebInstaller.php.

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

Here is the call graph for this function:

Show an error message in a box.

Parameters are like wfMsg().

Parameters:
$msg

Reimplemented from Installer.

Definition at line 360 of file WebInstaller.php.

References getErrorBox(), and wfMsgReal().

Referenced by envCheckPath(), and startSession().

Here is the call graph for this function:

Here is the caller graph for this function:

Output a help box.

Parameters:
$msgString key for wfMsg()

Definition at line 655 of file WebInstaller.php.

Show a short informational message.

Output looks like a list.

Parameters:
$msgstring

Reimplemented from Installer.

Definition at line 667 of file WebInstaller.php.

References Installer\parse(), and wfMsgReal().

Here is the call graph for this function:

Output an error or warning box using a Status object.

Parameters:
$statusStatus

Definition at line 971 of file WebInstaller.php.

References getErrorBox(), and getWarningBox().

Here is the call graph for this function:

Parameters:
$statusStatus

Reimplemented from Installer.

Definition at line 679 of file WebInstaller.php.

References Status\getErrorsArray(), and Status\getWarningsArray().

Here is the call graph for this function:

WebInstaller::startPageWrapper ( currentPageName) [private]

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

Parameters:
$currentPageNameString

Definition at line 504 of file WebInstaller.php.

References $currentPageName, Html\element(), getPageListItem(), and wfMsg().

Referenced by execute().

Here is the call graph for this function:

Here is the caller graph for this function:

Start the PHP session.

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

Returns:
bool

Definition at line 310 of file WebInstaller.php.

References showError(), and wfIniGetBool().

Here is the call graph for this function:


Member Data Documentation

WebInstaller::$currentPageName [protected]

Definition at line 106 of file WebInstaller.php.

Referenced by getPageListItem(), and startPageWrapper().

WebInstaller::$happyPages [protected]

Definition at line 80 of file WebInstaller.php.

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

Definition at line 67 of file WebInstaller.php.

WebInstaller::$output

Definition at line 20 of file WebInstaller.php.

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

Definition at line 50 of file WebInstaller.php.

WebInstaller::$phpErrors [protected]

Definition at line 40 of file WebInstaller.php.

WebInstaller::$request

Definition at line 27 of file WebInstaller.php.

Referenced by __construct().

WebInstaller::$session [protected]

Definition at line 34 of file WebInstaller.php.

Referenced by execute().

WebInstaller::$showSessionWarning = false

Definition at line 94 of file WebInstaller.php.

WebInstaller::$skippedPages [protected]

Definition at line 88 of file WebInstaller.php.

WebInstaller::$tabIndex = 1 [protected]

Definition at line 100 of file WebInstaller.php.


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