r18628 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r18627‎ | r18628 | r18629 >
Date:08:16, 29 December 2006
Author:brion
Status:old
Tags:
Comment:
* Use raw file descriptor in posix_isatty() check to avoid warning on
Linux systems with at least some versions of PHP

For some reason posix_isatty(STDIN) prints a warning on Linux about being unable to seek, though it gives the right return value and has no obvious ill effects otherwise.
No such warning appears on Mac OS X.
Using the raw file descriptor number (0 for stdin) seems to work, and is already used in the parser test framework where it checks stdout (1) this way.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/install-utils.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/install-utils.inc
@@ -63,7 +63,7 @@
6464 function readconsole( $prompt = '' ) {
6565 static $isatty = null;
6666 if ( is_null( $isatty ) ) {
67 - if ( !function_exists( 'posix_isatty' ) || posix_isatty( STDIN ) ) {
 67+ if ( !function_exists( 'posix_isatty' ) || posix_isatty( 0 /*STDIN*/ ) ) {
6868 $isatty = true;
6969 } else {
7070 $isatty = false;
Index: trunk/phase3/RELEASE-NOTES
@@ -421,6 +421,8 @@
422422 parser tests when Chinese tables were getting loaded into Serbian code.
423423 * (bug 8380) Be nicer about blank lines in deleteBatch.php
424424 * (bug 8401) Fix regression in SORBS lookup for some DNS setups
 425+* Use raw file descriptor in posix_isatty() check to avoid warning on
 426+ Linux systems with at least some versions of PHP
425427
426428
427429 == Languages updated ==