X-Git-Url: http://git.cyclocoop.org/%22.%20generer_url_ecrire%28%22sites_tous%22%2C%22%22%29.%20%22?a=blobdiff_plain;f=maintenance%2FMaintenance.php;h=cec12709625a482ff973a32cafbd103b52023573;hb=392af46809d831514f49618cdef1e1529d7fddf4;hp=5d76cdffb80837a04d7153c081ef4bc4f43b6bdc;hpb=c071aaac159d8a750389656af29e5eb907126c19;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index 5d76cdffb8..cec1270962 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -32,7 +32,7 @@ define( 'DO_MAINTENANCE', RUN_MAINTENANCE_IF_MAIN ); // original name, harmless $maintClass = false; // Make sure we're on PHP5 or better -if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.2.3' ) < 0 ) { +if ( !function_exists( 'version_compare' ) || version_compare( PHP_VERSION, '5.3.2' ) < 0 ) { require_once( dirname( __FILE__ ) . '/../includes/PHPVersionError.php' ); wfPHPVersionError( 'cli' ); } @@ -320,11 +320,7 @@ abstract class Maintenance { } if ( $channel === null ) { $this->cleanupChanneled(); - if( php_sapi_name() == 'cli' ) { - fwrite( STDOUT, $out ); - } else { - print( $out ); - } + print( $out ); } else { $out = preg_replace( '/\n\z/', '', $out ); $this->outputChanneled( $out, $channel ); @@ -358,11 +354,7 @@ abstract class Maintenance { */ public function cleanupChanneled() { if ( !$this->atLineStart ) { - if( php_sapi_name() == 'cli' ) { - fwrite( STDOUT, "\n" ); - } else { - print "\n"; - } + print "\n"; $this->atLineStart = true; } } @@ -381,31 +373,17 @@ abstract class Maintenance { return; } - $cli = php_sapi_name() == 'cli'; - // End the current line if necessary if ( !$this->atLineStart && $channel !== $this->lastChannel ) { - if( $cli ) { - fwrite( STDOUT, "\n" ); - } else { - print "\n"; - } + print "\n"; } - if( $cli ) { - fwrite( STDOUT, $msg ); - } else { - print $msg; - } + print $msg; $this->atLineStart = false; if ( $channel === null ) { // For unchanneled messages, output trailing newline immediately - if( $cli ) { - fwrite( STDOUT, "\n" ); - } else { - print "\n"; - } + print "\n"; $this->atLineStart = true; } $this->lastChannel = $channel;