/**
* Cached session array.
*
- * @var array
+ * @var array[]
*/
protected $session;
/**
* Captured PHP error text. Temporary.
- * @var array
+ *
+ * @var string[]
*/
protected $phpErrors;
* * Add it to this WebInstaller::$pageSequence property
* * Add a "config-page-<name>" message
* * Add a "WebInstaller_<name>" class
- * @var array
+ *
+ * @var string[]
*/
public $pageSequence = array(
'Language',
/**
* Out of sequence pages, selectable by the user at any time.
- * @var array
+ *
+ * @var string[]
*/
protected $otherPages = array(
'Restart',
/**
* Array of pages which have declared that they have been submitted, have validated
* their input, and need no further processing.
- * @var array
+ *
+ * @var bool[]
*/
protected $happyPages;
* 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.
- * @var array
+ *
+ * @var bool[]
*/
protected $skippedPages;
/**
* Flag indicating that session data may have been lost.
+ *
* @var bool
*/
public $showSessionWarning = false;
/**
* Numeric index of the page we're on
+ *
* @var int
*/
protected $tabIndex = 1;
/**
* Name of the page we're on
+ *
* @var string
*/
protected $currentPageName;
/**
* Constructor.
*
- * @param $request WebRequest
+ * @param WebRequest $request
*/
public function __construct( WebRequest $request ) {
parent::__construct();
/**
* Main entry point.
*
- * @param array $session initial session array
+ * @param array[] $session initial session array
*
- * @return Array: new session array
+ * @return array[] New session array
*/
public function execute( array $session ) {
$this->session = $session;
/**
* Start the PHP session. This may be called before execute() to start the PHP session.
*
+ * @throws Exception
* @return bool
*/
public function startSession() {
$this->phpErrors = array();
set_error_handler( array( $this, 'errorHandler' ) );
- session_start();
+ try {
+ session_start();
+ } catch ( Exception $e ) {
+ restore_error_handler();
+ throw $e;
+ }
restore_error_handler();
if ( $this->phpErrors ) {
/**
* Show an error message in a box. Parameters are like wfMessage().
- * @param $msg
+ * @param string $msg
*/
public function showError( $msg /*...*/ ) {
$args = func_get_args();
/**
* Temporary error handler for session start debugging.
- * @param $errno
- * @param $errstr string
+ *
+ * @param int $errno Unused
+ * @param string $errstr
*/
public function errorHandler( $errno, $errstr ) {
$this->phpErrors[] = $errstr;
/**
* Clean up from execute()
*
- * @return array
+ * @return array[]
*/
public function finish() {
$this->output->output();
/**
* Get a URL for submission back to the same script.
*
- * @param $query array
+ * @param string[] $query
+ *
* @return string
*/
public function getUrl( $query = array() ) {
/**
* Get a WebInstallerPage by name.
*
- * @param $pageName String
+ * @param string $pageName
* @return WebInstallerPage
*/
public function getPageByName( $pageName ) {
/**
* Get a session variable.
*
- * @param $name String
- * @param $default
- * @return null
+ * @param string $name
+ * @param array $default
+ *
+ * @return array
*/
public function getSession( $name, $default = null ) {
if ( !isset( $this->session[$name] ) ) {
/**
* Set a session variable.
- * @param string $name key for the variable
- * @param $value Mixed
+ *
+ * @param string $name Key for the variable
+ * @param mixed $value
*/
public function setSession( $name, $value ) {
$this->session[$name] = $value;
/**
* Get the next tabindex attribute value.
+ *
* @return int
*/
public function nextTabIndex() {
/**
* Called by execute() before page output starts, to show a page list.
*
- * @param $currentPageName string
+ * @param string $currentPageName
*/
private function startPageWrapper( $currentPageName ) {
$s = "<div class=\"config-page-wrapper\">\n";
/**
* Get a list item for the page list.
*
- * @param $pageName string
- * @param $enabled boolean
- * @param $currentPageName string
+ * @param string $pageName
+ * @param bool $enabled
+ * @param string $currentPageName
*
* @return string
*/
/**
* Get HTML for an error box with an icon.
*
- * @param string $text wikitext, get this with wfMessage()->plain()
+ * @param string $text Wikitext, get this with wfMessage()->plain()
*
* @return string
*/
/**
* Get HTML for a warning box with an icon.
*
- * @param string $text wikitext, get this with wfMessage()->plain()
+ * @param string $text Wikitext, get this with wfMessage()->plain()
*
* @return string
*/
/**
* Get HTML for an info box with an icon.
*
- * @param string $text wikitext, get this with wfMessage()->plain()
- * @param string $icon icon name, file in skins/common/images
- * @param string $class additional class name to add to the wrapper div
+ * @param string $text Wikitext, get this with wfMessage()->plain()
+ * @param string|bool $icon Icon name, file in skins/common/images. Default: false
+ * @param string|bool $class Additional class name to add to the wrapper div. Default: false.
*
* @return string
*/
public function getInfoBox( $text, $icon = false, $class = false ) {
$text = $this->parse( $text, true );
- $icon = ( $icon == false ) ? '../skins/common/images/info-32.png' : '../skins/common/images/' . $icon;
+ $icon = ( $icon == false ) ?
+ '../skins/common/images/info-32.png' :
+ '../skins/common/images/' . $icon;
$alt = wfMessage( 'config-information' )->text();
return Html::infoBox( $text, $icon, $alt, $class, false );
* Get small text indented help for a preceding form field.
* Parameters like wfMessage().
*
- * @param $msg
+ * @param string $msg
* @return string
*/
public function getHelpBox( $msg /*, ... */ ) {
$html = $this->parse( $text, true );
return "<div class=\"mw-help-field-container\">\n" .
- "<span class=\"mw-help-field-hint\">" . wfMessage( 'config-help' )->escaped() .
- "</span>\n" .
+ "<span class=\"mw-help-field-hint\" title=\"" . wfMessage( 'config-help-tooltip' )->escaped() . "\">" .
+ wfMessage( 'config-help' )->escaped() . "</span>\n" .
"<span class=\"mw-help-field-data\">" . $html . "</span>\n" .
"</div>\n";
}
/**
* Output a help box.
- * @param string $msg key for wfMessage()
+ * @param string $msg Key for wfMessage()
*/
public function showHelpBox( $msg /*, ... */ ) {
$args = func_get_args();
* Show a short informational message.
* Output looks like a list.
*
- * @param $msg string
+ * @param string $msg
*/
public function showMessage( $msg /*, ... */ ) {
$args = func_get_args();
}
/**
- * @param $status Status
+ * @param Status $status
*/
public function showStatusMessage( Status $status ) {
$errors = array_merge( $status->getErrorsArray(), $status->getWarningsArray() );
* Label a control by wrapping a config-input div around it and putting a
* label before it.
*
- * @param $msg
- * @param $forId
- * @param $contents
- * @param $helpData string
+ * @param string $msg
+ * @param string $forId
+ * @param string $contents
+ * @param string $helpData
* @return string
*/
public function label( $msg, $forId, $contents, $helpData = "" ) {
/**
* Get a labelled text box to configure a variable.
*
- * @param $params Array
+ * @param mixed[] $params
* Parameters are:
* var: The variable to be configured (required)
* label: The message name for the label (required)
/**
* Get a labelled textarea to configure a variable
*
- * @param $params Array
+ * @param mixed[] $params
* Parameters are:
* var: The variable to be configured (required)
* label: The message name for the label (required)
* Get a labelled password box to configure a variable.
*
* Implements password hiding
- * @param $params Array
+ * @param mixed[] $params
* Parameters are:
* var: The variable to be configured (required)
* label: The message name for the label (required)
/**
* Get a labelled checkbox to configure a boolean variable.
*
- * @param $params Array
+ * @param mixed[] $params
* Parameters are:
* var: The variable to be configured (required)
* label: The message name for the label (required)
/**
* Get a set of labelled radio buttons.
*
- * @param $params Array
+ * @param mixed[] $params
* Parameters are:
* var: The variable to be configured (required)
* label: The message name for the label (required)
/**
* Output an error or warning box using a Status object.
*
- * @param $status Status
+ * @param Status $status
*/
public function showStatusBox( $status ) {
if ( !$status->isGood() ) {
* Assumes that variables containing "password" in the name are (potentially
* fake) passwords.
*
- * @param $varNames Array
- * @param string $prefix the prefix added to variables to obtain form names
+ * @param string[] $varNames
+ * @param string $prefix The prefix added to variables to obtain form names
*
- * @return array
+ * @return string[]
*/
public function setVarsFromRequest( $varNames, $prefix = 'config_' ) {
$newValues = array();
/**
* Helper for Installer::docLink()
*
- * @param $page
+ * @param string $page
+ *
* @return string
*/
protected function getDocUrl( $page ) {
/**
* Extension tag hook for a documentation link.
*
- * @param $linkText
- * @param $attribs
- * @param $parser
+ * @param string $linkText
+ * @param string[] $attribs
+ * @param Parser $parser Unused
+ *
* @return string
*/
public function docLink( $linkText, $attribs, $parser ) {
/**
* Helper for "Download LocalSettings" link on WebInstall_Complete
*
- * @param $text
- * @param $attribs
- * @param $parser
- * @return String Html for download link
+ * @param string $text Unused
+ * @param string[] $attribs Unused
+ * @param Parser $parser Unused
+ *
+ * @return string Html for download link
*/
public function downloadLinkHook( $text, $attribs, $parser ) {
- $img = Html::element( 'img', array(
- 'src' => '../skins/common/images/download-32.png',
- 'width' => '32',
- 'height' => '32',
- ) );
$anchor = Html::rawElement( 'a',
array( 'href' => $this->getURL( array( 'localsettings' => 1 ) ) ),
- $img . ' ' . wfMessage( 'config-download-localsettings' )->parse() );
+ wfMessage( 'config-download-localsettings' )->parse()
+ );
return Html::rawElement( 'div', array( 'class' => 'config-download-link' ), $anchor );
}
return parent::envCheckPath();
}
+ /**
+ * @return string
+ */
protected function envGetDefaultServer() {
return WebRequest::detectServer();
}
-}
+
+}
\ No newline at end of file