From f675c6bf054aea9c14b329366b23d2ae5e78fdb3 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Mon, 2 May 2011 16:58:29 +0000 Subject: [PATCH] Documentation --- includes/db/LBFactory_Single.php | 2 +- includes/installer/CliInstaller.php | 2 ++ includes/installer/DatabaseInstaller.php | 6 +++++ includes/installer/Installer.php | 9 +++++++ includes/installer/WebInstaller.php | 33 ++++++++++++++++++++++- includes/installer/WebInstallerOutput.php | 19 ++++++++++--- includes/installer/WebInstallerPage.php | 6 +++++ 7 files changed, 71 insertions(+), 6 deletions(-) diff --git a/includes/db/LBFactory_Single.php b/includes/db/LBFactory_Single.php index e8b5fe8267..a0089d51f8 100644 --- a/includes/db/LBFactory_Single.php +++ b/includes/db/LBFactory_Single.php @@ -7,7 +7,7 @@ class LBFactory_Single extends LBFactory { protected $lb; /** - * @param $conf An associative array with one member: + * @param $conf array An associative array with one member: * - connection: The DatabaseBase connection object */ function __construct( $conf ) { diff --git a/includes/installer/CliInstaller.php b/includes/installer/CliInstaller.php index 0a9993770c..66e779e8b7 100644 --- a/includes/installer/CliInstaller.php +++ b/includes/installer/CliInstaller.php @@ -131,6 +131,8 @@ class CliInstaller extends Installer { } /** + * @param $params array + * * @return string */ protected function getMessageText( $params ) { diff --git a/includes/installer/DatabaseInstaller.php b/includes/installer/DatabaseInstaller.php index 3594f350d6..7ea5296357 100644 --- a/includes/installer/DatabaseInstaller.php +++ b/includes/installer/DatabaseInstaller.php @@ -365,6 +365,8 @@ abstract class DatabaseInstaller { /** * Get a labelled text box to configure a local variable. + * + * @return string */ public function getTextBox( $var, $label, $attribs = array(), $helpData = "" ) { $name = $this->getName() . '_' . $var; @@ -385,6 +387,8 @@ abstract class DatabaseInstaller { /** * Get a labelled password box to configure a local variable. * Implements password hiding. + * + * @return string */ public function getPasswordBox( $var, $label, $attribs = array(), $helpData = "" ) { $name = $this->getName() . '_' . $var; @@ -404,6 +408,8 @@ abstract class DatabaseInstaller { /** * Get a labelled checkbox to configure a local boolean variable. + * + * @return string */ public function getCheckBox( $var, $label, $attribs = array(), $helpData = "" ) { $name = $this->getName() . '_' . $var; diff --git a/includes/installer/Installer.php b/includes/installer/Installer.php index ba01145f66..58ce470fe6 100644 --- a/includes/installer/Installer.php +++ b/includes/installer/Installer.php @@ -354,6 +354,8 @@ abstract class Installer { /** * Get a list of known DB types. + * + * @return array */ public static function getDBTypes() { return self::$dbTypes; @@ -557,6 +559,9 @@ abstract class Installer { return $html; } + /** + * @return ParserOptions + */ public function getParserOptions() { return $this->parserOptions; } @@ -573,6 +578,10 @@ abstract class Installer { /** * Install step which adds a row to the site_stats table with appropriate * initial values. + * + * @param $installer DatabaseInstaller + * + * @return Status */ public function populateSiteStats( DatabaseInstaller $installer ) { $status = $installer->getConnection(); diff --git a/includes/installer/WebInstaller.php b/includes/installer/WebInstaller.php index 0d007260c3..a751d03d99 100644 --- a/includes/installer/WebInstaller.php +++ b/includes/installer/WebInstaller.php @@ -296,6 +296,8 @@ class WebInstaller extends Installer { /** * Start the PHP session. This may be called before execute() to start the PHP session. + * + * @return bool */ public function startSession() { if( wfIniGetBool( 'session.auto_start' ) || session_id() ) { @@ -321,6 +323,8 @@ class WebInstaller extends Installer { * * This is used by mw-config/index.php to prevent multiple installations of MW * on the same cookie domain from interfering with each other. + * + * @return string */ public function getFingerprint() { // Get the base URL of the installation @@ -386,7 +390,7 @@ class WebInstaller extends Installer { /** * Get a URL for submission back to the same script. * - * @param $query: Array + * @param $query array * @return string */ public function getUrl( $query = array() ) { @@ -580,6 +584,8 @@ class WebInstaller extends Installer { * Get HTML for an error box with an icon. * * @param $text String: wikitext, get this with wfMsgNoTrans() + * + * @return string */ public function getErrorBox( $text ) { return $this->getInfoBox( $text, 'critical-32.png', 'config-error-box' ); @@ -589,6 +595,8 @@ class WebInstaller extends Installer { * Get HTML for a warning box with an icon. * * @param $text String: wikitext, get this with wfMsgNoTrans() + * + * @return string */ public function getWarningBox( $text ) { return $this->getInfoBox( $text, 'warning-32.png', 'config-warning-box' ); @@ -600,6 +608,8 @@ class WebInstaller extends Installer { * @param $text String: wikitext, get this with wfMsgNoTrans() * @param $icon String: icon name, file in skins/common/images * @param $class String: additional class name to add to the wrapper div + * + * @return string */ public function getInfoBox( $text, $icon = 'info-32.png', $class = false ) { $s = @@ -623,6 +633,8 @@ class WebInstaller extends Installer { /** * Get small text indented help for a preceding form field. * Parameters like wfMsg(). + * + * @return string */ public function getHelpBox( $msg /*, ... */ ) { $args = func_get_args(); @@ -678,6 +690,8 @@ class WebInstaller extends Installer { /** * Label a control by wrapping a config-input div around it and putting a * label before it. + * + * @return string */ public function label( $msg, $forId, $contents, $helpData = "" ) { if ( strval( $msg ) == '' ) { @@ -717,6 +731,8 @@ class WebInstaller extends Installer { * controlName: The name for the input element (optional) * value: The current value of the variable (optional) * help: The html for the help text (optional) + * + * @return string */ public function getTextBox( $params ) { if ( !isset( $params['controlName'] ) ) { @@ -762,6 +778,8 @@ class WebInstaller extends Installer { * controlName: The name for the input element (optional) * value: The current value of the variable (optional) * help: The html for the help text (optional) + * + * @return string */ public function getTextArea( $params ) { if ( !isset( $params['controlName'] ) ) { @@ -809,6 +827,8 @@ class WebInstaller extends Installer { * controlName: The name for the input element (optional) * value: The current value of the variable (optional) * help: The html for the help text (optional) + * + * @return string */ public function getPasswordBox( $params ) { if ( !isset( $params['value'] ) ) { @@ -836,6 +856,8 @@ class WebInstaller extends Installer { * controlName: The name for the input element (optional) * value: The current value of the variable (optional) * help: The html for the help text (optional) + * + * @return string */ public function getCheckBox( $params ) { if ( !isset( $params['controlName'] ) ) { @@ -889,6 +911,8 @@ class WebInstaller extends Installer { * controlName: The name for the input element (optional) * value: The current value of the variable (optional) * help: The html for the help text (optional) + * + * @return string */ public function getRadioSet( $params ) { if ( !isset( $params['controlName'] ) ) { @@ -963,6 +987,8 @@ class WebInstaller extends Installer { * * @param $varNames Array * @param $prefix String: the prefix added to variables to obtain form names + * + * @return array */ public function setVarsFromRequest( $varNames, $prefix = 'config_' ) { $newValues = array(); @@ -988,6 +1014,8 @@ class WebInstaller extends Installer { /** * Helper for Installer::docLink() + * + * @return string */ protected function getDocUrl( $page ) { $url = "{$_SERVER['PHP_SELF']}?page=" . urlencode( $page ); @@ -1001,6 +1029,8 @@ class WebInstaller extends Installer { /** * Extension tag hook for a documentation link. + * + * @return string */ public function docLink( $linkText, $attribs, $parser ) { $url = $this->getDocUrl( $attribs['href'] ); @@ -1011,6 +1041,7 @@ class WebInstaller extends Installer { /** * Helper for "Download LocalSettings" link on WebInstall_Complete + * * @return String Html for download link */ public function downloadLinkHook( $text, $attribs, $parser ) { diff --git a/includes/installer/WebInstallerOutput.php b/includes/installer/WebInstallerOutput.php index cb708d1392..443cf5ab40 100644 --- a/includes/installer/WebInstallerOutput.php +++ b/includes/installer/WebInstallerOutput.php @@ -139,22 +139,33 @@ class WebInstallerOutput { } } + /** + * @return string + */ public function getDir() { global $wgLang; - if( !is_object( $wgLang ) || !$wgLang->isRtl() ) + if( !is_object( $wgLang ) || !$wgLang->isRtl() ) { return 'ltr'; - else + } else { return 'rtl'; + } } + /** + * @return string + */ public function getLanguageCode() { global $wgLang; - if( !is_object( $wgLang ) ) + if( !is_object( $wgLang ) ) { return 'en'; - else + } else { return $wgLang->getCode(); + } } + /** + * @return array + */ public function getHeadAttribs() { return array( 'dir' => $this->getDir(), diff --git a/includes/installer/WebInstallerPage.php b/includes/installer/WebInstallerPage.php index 1d3daf2892..64b64d6358 100644 --- a/includes/installer/WebInstallerPage.php +++ b/includes/installer/WebInstallerPage.php @@ -103,6 +103,8 @@ abstract class WebInstallerPage { * Get the starting tags of a fieldset. * * @param $legend String: message name + * + * @return string */ protected function getFieldsetStart( $legend ) { return "\n
" . wfMsgHtml( $legend ) . "\n"; @@ -110,6 +112,8 @@ abstract class WebInstallerPage { /** * Get the end tag of a fieldset. + * + * @returns string */ protected function getFieldsetEnd() { return "
\n"; @@ -198,6 +202,8 @@ class WebInstaller_Language extends WebInstallerPage { /** * Get a