r78532 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78531‎ | r78532 | r78533 >
Date:15:31, 17 December 2010
Author:demon
Status:ok
Tags:
Comment:
* Handle output for DatabaseUpdater in the class itself, no more wfOut() usage in core :)
* Mark wfOut() deprecated
* CheckUser, OpenID and TitleKey still use wfOut :(
Modified paths:
  • /trunk/phase3/includes/GlobalFunctions.php (modified) (history)
  • /trunk/phase3/includes/installer/DatabaseUpdater.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/GlobalFunctions.php
@@ -3374,8 +3374,8 @@
33753375 }
33763376
33773377 /**
3378 - * Output some plain text in command-line mode or in the installer (updaters.inc).
3379 - * Do not use it in any other context, its behaviour is subject to change.
 3378+ * Used to be used for outputting text in the installer/updater
 3379+ * @deprecated Warnings in 1.19, removal in 1.20
33803380 */
33813381 function wfOut( $s ) {
33823382 global $wgCommandLineMode;
Index: trunk/phase3/includes/installer/DatabaseUpdater.php
@@ -91,8 +91,7 @@
9292 }
9393
9494 /**
95 - * Output some text. Right now this is a wrapper for wfOut, but hopefully
96 - * that function can go away some day :)
 95+ * Output some text. If we're running from web, escape the text first.
9796 *
9897 * @param $str String: Text to output
9998 */
@@ -100,7 +99,12 @@
101100 if ( $this->maintenance->isQuiet() ) {
102101 return;
103102 }
104 - wfOut( $str );
 103+ global $wgCommandLineMode;
 104+ if( !$wgCommandLineMode ) {
 105+ $str = htmlspecialchars( $str );
 106+ }
 107+ echo $str;
 108+ flush();
105109 }
106110
107111 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r801901.17: MFT first batch of installer changes: r78043, r78231, r78259, r78300, r...catrope20:47, 13 January 2011

Status & tagging log