r87256 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87255‎ | r87256 | r87257 >
Date:16:58, 2 May 2011
Author:reedy
Status:ok
Tags:
Comment:
Documentation
Modified paths:
  • /trunk/phase3/includes/db/LBFactory_Single.php (modified) (history)
  • /trunk/phase3/includes/installer/CliInstaller.php (modified) (history)
  • /trunk/phase3/includes/installer/DatabaseInstaller.php (modified) (history)
  • /trunk/phase3/includes/installer/Installer.php (modified) (history)
  • /trunk/phase3/includes/installer/WebInstaller.php (modified) (history)
  • /trunk/phase3/includes/installer/WebInstallerOutput.php (modified) (history)
  • /trunk/phase3/includes/installer/WebInstallerPage.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/db/LBFactory_Single.php
@@ -7,7 +7,7 @@
88 protected $lb;
99
1010 /**
11 - * @param $conf An associative array with one member:
 11+ * @param $conf array An associative array with one member:
1212 * - connection: The DatabaseBase connection object
1313 */
1414 function __construct( $conf ) {
Index: trunk/phase3/includes/installer/WebInstaller.php
@@ -296,6 +296,8 @@
297297
298298 /**
299299 * Start the PHP session. This may be called before execute() to start the PHP session.
 300+ *
 301+ * @return bool
300302 */
301303 public function startSession() {
302304 if( wfIniGetBool( 'session.auto_start' ) || session_id() ) {
@@ -321,6 +323,8 @@
322324 *
323325 * This is used by mw-config/index.php to prevent multiple installations of MW
324326 * on the same cookie domain from interfering with each other.
 327+ *
 328+ * @return string
325329 */
326330 public function getFingerprint() {
327331 // Get the base URL of the installation
@@ -386,7 +390,7 @@
387391 /**
388392 * Get a URL for submission back to the same script.
389393 *
390 - * @param $query: Array
 394+ * @param $query array
391395 * @return string
392396 */
393397 public function getUrl( $query = array() ) {
@@ -580,6 +584,8 @@
581585 * Get HTML for an error box with an icon.
582586 *
583587 * @param $text String: wikitext, get this with wfMsgNoTrans()
 588+ *
 589+ * @return string
584590 */
585591 public function getErrorBox( $text ) {
586592 return $this->getInfoBox( $text, 'critical-32.png', 'config-error-box' );
@@ -589,6 +595,8 @@
590596 * Get HTML for a warning box with an icon.
591597 *
592598 * @param $text String: wikitext, get this with wfMsgNoTrans()
 599+ *
 600+ * @return string
593601 */
594602 public function getWarningBox( $text ) {
595603 return $this->getInfoBox( $text, 'warning-32.png', 'config-warning-box' );
@@ -600,6 +608,8 @@
601609 * @param $text String: wikitext, get this with wfMsgNoTrans()
602610 * @param $icon String: icon name, file in skins/common/images
603611 * @param $class String: additional class name to add to the wrapper div
 612+ *
 613+ * @return string
604614 */
605615 public function getInfoBox( $text, $icon = 'info-32.png', $class = false ) {
606616 $s =
@@ -623,6 +633,8 @@
624634 /**
625635 * Get small text indented help for a preceding form field.
626636 * Parameters like wfMsg().
 637+ *
 638+ * @return string
627639 */
628640 public function getHelpBox( $msg /*, ... */ ) {
629641 $args = func_get_args();
@@ -678,6 +690,8 @@
679691 /**
680692 * Label a control by wrapping a config-input div around it and putting a
681693 * label before it.
 694+ *
 695+ * @return string
682696 */
683697 public function label( $msg, $forId, $contents, $helpData = "" ) {
684698 if ( strval( $msg ) == '' ) {
@@ -717,6 +731,8 @@
718732 * controlName: The name for the input element (optional)
719733 * value: The current value of the variable (optional)
720734 * help: The html for the help text (optional)
 735+ *
 736+ * @return string
721737 */
722738 public function getTextBox( $params ) {
723739 if ( !isset( $params['controlName'] ) ) {
@@ -762,6 +778,8 @@
763779 * controlName: The name for the input element (optional)
764780 * value: The current value of the variable (optional)
765781 * help: The html for the help text (optional)
 782+ *
 783+ * @return string
766784 */
767785 public function getTextArea( $params ) {
768786 if ( !isset( $params['controlName'] ) ) {
@@ -809,6 +827,8 @@
810828 * controlName: The name for the input element (optional)
811829 * value: The current value of the variable (optional)
812830 * help: The html for the help text (optional)
 831+ *
 832+ * @return string
813833 */
814834 public function getPasswordBox( $params ) {
815835 if ( !isset( $params['value'] ) ) {
@@ -836,6 +856,8 @@
837857 * controlName: The name for the input element (optional)
838858 * value: The current value of the variable (optional)
839859 * help: The html for the help text (optional)
 860+ *
 861+ * @return string
840862 */
841863 public function getCheckBox( $params ) {
842864 if ( !isset( $params['controlName'] ) ) {
@@ -889,6 +911,8 @@
890912 * controlName: The name for the input element (optional)
891913 * value: The current value of the variable (optional)
892914 * help: The html for the help text (optional)
 915+ *
 916+ * @return string
893917 */
894918 public function getRadioSet( $params ) {
895919 if ( !isset( $params['controlName'] ) ) {
@@ -963,6 +987,8 @@
964988 *
965989 * @param $varNames Array
966990 * @param $prefix String: the prefix added to variables to obtain form names
 991+ *
 992+ * @return array
967993 */
968994 public function setVarsFromRequest( $varNames, $prefix = 'config_' ) {
969995 $newValues = array();
@@ -988,6 +1014,8 @@
9891015
9901016 /**
9911017 * Helper for Installer::docLink()
 1018+ *
 1019+ * @return string
9921020 */
9931021 protected function getDocUrl( $page ) {
9941022 $url = "{$_SERVER['PHP_SELF']}?page=" . urlencode( $page );
@@ -1001,6 +1029,8 @@
10021030
10031031 /**
10041032 * Extension tag hook for a documentation link.
 1033+ *
 1034+ * @return string
10051035 */
10061036 public function docLink( $linkText, $attribs, $parser ) {
10071037 $url = $this->getDocUrl( $attribs['href'] );
@@ -1011,6 +1041,7 @@
10121042
10131043 /**
10141044 * Helper for "Download LocalSettings" link on WebInstall_Complete
 1045+ *
10151046 * @return String Html for download link
10161047 */
10171048 public function downloadLinkHook( $text, $attribs, $parser ) {
Index: trunk/phase3/includes/installer/Installer.php
@@ -354,6 +354,8 @@
355355
356356 /**
357357 * Get a list of known DB types.
 358+ *
 359+ * @return array
358360 */
359361 public static function getDBTypes() {
360362 return self::$dbTypes;
@@ -557,6 +559,9 @@
558560 return $html;
559561 }
560562
 563+ /**
 564+ * @return ParserOptions
 565+ */
561566 public function getParserOptions() {
562567 return $this->parserOptions;
563568 }
@@ -573,6 +578,10 @@
574579 /**
575580 * Install step which adds a row to the site_stats table with appropriate
576581 * initial values.
 582+ *
 583+ * @param $installer DatabaseInstaller
 584+ *
 585+ * @return Status
577586 */
578587 public function populateSiteStats( DatabaseInstaller $installer ) {
579588 $status = $installer->getConnection();
Index: trunk/phase3/includes/installer/WebInstallerOutput.php
@@ -139,22 +139,33 @@
140140 }
141141 }
142142
 143+ /**
 144+ * @return string
 145+ */
143146 public function getDir() {
144147 global $wgLang;
145 - if( !is_object( $wgLang ) || !$wgLang->isRtl() )
 148+ if( !is_object( $wgLang ) || !$wgLang->isRtl() ) {
146149 return 'ltr';
147 - else
 150+ } else {
148151 return 'rtl';
 152+ }
149153 }
150154
 155+ /**
 156+ * @return string
 157+ */
151158 public function getLanguageCode() {
152159 global $wgLang;
153 - if( !is_object( $wgLang ) )
 160+ if( !is_object( $wgLang ) ) {
154161 return 'en';
155 - else
 162+ } else {
156163 return $wgLang->getCode();
 164+ }
157165 }
158166
 167+ /**
 168+ * @return array
 169+ */
159170 public function getHeadAttribs() {
160171 return array(
161172 'dir' => $this->getDir(),
Index: trunk/phase3/includes/installer/DatabaseInstaller.php
@@ -365,6 +365,8 @@
366366
367367 /**
368368 * Get a labelled text box to configure a local variable.
 369+ *
 370+ * @return string
369371 */
370372 public function getTextBox( $var, $label, $attribs = array(), $helpData = "" ) {
371373 $name = $this->getName() . '_' . $var;
@@ -385,6 +387,8 @@
386388 /**
387389 * Get a labelled password box to configure a local variable.
388390 * Implements password hiding.
 391+ *
 392+ * @return string
389393 */
390394 public function getPasswordBox( $var, $label, $attribs = array(), $helpData = "" ) {
391395 $name = $this->getName() . '_' . $var;
@@ -404,6 +408,8 @@
405409
406410 /**
407411 * Get a labelled checkbox to configure a local boolean variable.
 412+ *
 413+ * @return string
408414 */
409415 public function getCheckBox( $var, $label, $attribs = array(), $helpData = "" ) {
410416 $name = $this->getName() . '_' . $var;
Index: trunk/phase3/includes/installer/CliInstaller.php
@@ -131,6 +131,8 @@
132132 }
133133
134134 /**
 135+ * @param $params array
 136+ *
135137 * @return string
136138 */
137139 protected function getMessageText( $params ) {
Index: trunk/phase3/includes/installer/WebInstallerPage.php
@@ -103,6 +103,8 @@
104104 * Get the starting tags of a fieldset.
105105 *
106106 * @param $legend String: message name
 107+ *
 108+ * @return string
107109 */
108110 protected function getFieldsetStart( $legend ) {
109111 return "\n<fieldset><legend>" . wfMsgHtml( $legend ) . "</legend>\n";
@@ -110,6 +112,8 @@
111113
112114 /**
113115 * Get the end tag of a fieldset.
 116+ *
 117+ * @returns string
114118 */
115119 protected function getFieldsetEnd() {
116120 return "</fieldset>\n";
@@ -198,6 +202,8 @@
199203
200204 /**
201205 * Get a <select> for selecting languages.
 206+ *
 207+ * @return string
202208 */
203209 public function getLanguageSelector( $name, $label, $selectedCode ) {
204210 global $wgDummyLanguageCodes;

Sign-offs

UserFlagDate
Krinkleinspected00:55, 2 June 2011

Status & tagging log