+ /**
+ * Write a message to stderr falling back to stdout if stderr unavailable
+ *
+ * @param string $message
+ * @suppress SecurityCheck-XSS
+ */
+ private function writeToCommandLine( $message ) {
+ // T17602: STDERR may not be available
+ if ( !defined( 'MW_PHPUNIT_TEST' ) && defined( 'STDERR' ) ) {
+ fwrite( STDERR, $message );
+ } else {
+ echo $message;
+ }
+ }
+