r103196 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r103195‎ | r103196 | r103197 >
Date:17:26, 15 November 2011
Author:demon
Status:ok
Tags:
Comment:
MFT r101644, 103179. Release notes seem to be already merged
Modified paths:
  • /branches/REL1_18/phase3/RELEASE-NOTES-1.18 (modified) (history)
  • /branches/REL1_18/phase3/maintenance/Maintenance.php (modified) (history)

Diff [purge]

Index: branches/REL1_18/phase3/maintenance/Maintenance.php
@@ -303,10 +303,11 @@
304304 }
305305 if ( $channel === null ) {
306306 $this->cleanupChanneled();
307 -
308 - $f = fopen( 'php://stdout', 'w' );
309 - fwrite( $f, $out );
310 - fclose( $f );
 307+ if( php_sapi_name() == 'cli' ) {
 308+ fwrite( STDOUT, $out );
 309+ } else {
 310+ print( $out );
 311+ }
311312 }
312313 else {
313314 $out = preg_replace( '/\n\z/', '', $out );
@@ -325,9 +326,7 @@
326327 if ( php_sapi_name() == 'cli' ) {
327328 fwrite( STDERR, $err . "\n" );
328329 } else {
329 - $f = fopen( 'php://stderr', 'w' );
330 - fwrite( $f, $err . "\n" );
331 - fclose( $f );
 330+ print $err;
332331 }
333332 $die = intval( $die );
334333 if ( $die > 0 ) {
@@ -343,9 +342,11 @@
344343 */
345344 public function cleanupChanneled() {
346345 if ( !$this->atLineStart ) {
347 - $handle = fopen( 'php://stdout', 'w' );
348 - fwrite( $handle, "\n" );
349 - fclose( $handle );
 346+ if( php_sapi_name() == 'cli' ) {
 347+ fwrite( STDOUT, "\n" );
 348+ } else {
 349+ print "\n";
 350+ }
350351 $this->atLineStart = true;
351352 }
352353 }
@@ -364,25 +365,34 @@
365366 return;
366367 }
367368
368 - $handle = fopen( 'php://stdout', 'w' );
 369+ $cli = php_sapi_name() == 'cli';
369370
370371 // End the current line if necessary
371372 if ( !$this->atLineStart && $channel !== $this->lastChannel ) {
372 - fwrite( $handle, "\n" );
 373+ if( $cli ) {
 374+ fwrite( STDOUT, "\n" );
 375+ } else {
 376+ print "\n";
 377+ }
373378 }
374379
375 - fwrite( $handle, $msg );
 380+ if( $cli ) {
 381+ fwrite( STDOUT, $msg );
 382+ } else {
 383+ print $msg;
 384+ }
376385
377386 $this->atLineStart = false;
378387 if ( $channel === null ) {
379388 // For unchanneled messages, output trailing newline immediately
380 - fwrite( $handle, "\n" );
 389+ if( $handle ) {
 390+ fwrite( STDOUT, "\n" );
 391+ } else {
 392+ print "\n";
 393+ }
381394 $this->atLineStart = true;
382395 }
383396 $this->lastChannel = $channel;
384 -
385 - // Cleanup handle
386 - fclose( $handle );
387397 }
388398
389399 /**
Property changes on: branches/REL1_18/phase3/maintenance/Maintenance.php
___________________________________________________________________
Added: svn:mergeinfo
390400 Merged /branches/sqlite/maintenance/Maintenance.php:r58211-58321
391401 Merged /trunk/phase3/maintenance/Maintenance.php:r92580,92634,92713,92762,92765,92791,92846,92854,92884,92886-92887,92894,92898,92907,92932,92958,93065,93141,93149,93151,93233-93234,93258,93266,93303,93516-93518,93520,93726,93818-93822,93834,93847,93858,93891,93935-93936,93977,94058,94062,94068,94107,94155,94171,94199,94235,94277,94346,94372,94422,94425,94444,94448,94456,94498,94517,94601,94630,94728,94738,94825,94862,94867,94995-94997,95023,95042,95072-95073,95155,95163,95327,95332,95410,95422,95426,95442,95468,95601,95812,96178,96182,96437-96438,96579,96616,96648,97175,97291,97806,97815,97821,97889,97895,98069,98193-98194,98210,98212,98235,98237,98298,98374,98379,98411,98426,98502,98602-98603,98605,98610,98612,98656,98665,98669,98676,98678,98703,98707,98713,98716,98718-98720,98755-98756,98760-98761,98774,98812,98880,98884,98927,98963,98975,98990,98997,99031,99081-99082,99091-99092,99102,99104,99118,99126,99135-99136,99138,99154,99172,99236,99250,99252,99254,99286,99304,99307-99308,99318,99321,99323,99332,99349,99353,99369-99371,99396,99477,99630,99632,99653,99680,99694,99700,99897,99910,99914,99931,99952,99994,100021,100115,100211,100219,100221,100223,100226,100239,100242,100347,100391,100398,100510,100572,100575-100576,100592,100701,101010,101306,101314,101370,101376,101417,101420,101445,101449-101451,101454,101464,101470,101476,101540,101591,101644,101666,101860,101990,102027,102297,102301,102303,102334-102335,102414,102416,102440,102488,102498,102537,102710,102751,102948,102951,102954,103074,103138,103179
392402 Merged /branches/new-installer/phase3/maintenance/Maintenance.php:r43664-66004
393403 Merged /branches/REL1_15/phase3/maintenance/Maintenance.php:r51646
394404 Merged /branches/wmf/1.18wmf1/maintenance/Maintenance.php:r97604,98962,98971,99004,99065
395405 Merged /branches/REL1_17/phase3/maintenance/Maintenance.php:r81445,81448
Property changes on: branches/REL1_18/phase3/RELEASE-NOTES-1.18
___________________________________________________________________
Modified: svn:mergeinfo
396406 Merged /trunk/phase3/RELEASE-NOTES-1.18:r101644

Follow-up revisions

RevisionCommit summaryAuthorDate
r103198Followup r103196, also need to MFT r103188demon17:29, 15 November 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r101644(bug 31822) Error during upgrade due to output buffer reset in stdout....demon18:03, 2 November 2011
r103179Address fixme on r101644 (bug 32325, bug 32263), originally for bug 31822. PH...demon15:04, 15 November 2011

Status & tagging log