Index: trunk/phase3/maintenance/Maintenance.php |
— | — | @@ -225,9 +225,13 @@ |
226 | 226 | * @param $die boolean If true, go ahead and die out. |
227 | 227 | */ |
228 | 228 | protected function error( $err, $die = false ) { |
229 | | - $f = fopen( 'php://stderr', 'w' ); |
230 | | - fwrite( $f, $err . "\n" ); |
231 | | - fclose( $f ); |
| 229 | + if ( php_sapi_name() == 'cli' ) { |
| 230 | + fwrite( STDERR, $err . "\n" ); |
| 231 | + } else { |
| 232 | + $f = fopen( 'php://stderr', 'w' ); |
| 233 | + fwrite( $f, $err . "\n" ); |
| 234 | + fclose( $f ); |
| 235 | + } |
232 | 236 | if( $die ) die(); |
233 | 237 | } |
234 | 238 | |