From 97a802407ecc2455e938dc02accd43ebb86204ae Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Thu, 5 Feb 2015 16:07:05 +1100 Subject: [PATCH] Workaround for HHVM bug in readline() https://github.com/facebook/hhvm/issues/4776 Change-Id: I9d3e6817cee2fa2c11e02989a4b11915f0c708f5 --- maintenance/Maintenance.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/maintenance/Maintenance.php b/maintenance/Maintenance.php index 9b98b206a8..af14bb36fc 100644 --- a/maintenance/Maintenance.php +++ b/maintenance/Maintenance.php @@ -1207,7 +1207,13 @@ abstract class Maintenance { } if ( $isatty && function_exists( 'readline' ) ) { - return readline( $prompt ); + $resp = readline( $prompt ); + if ( $resp === null ) { + // Workaround for https://github.com/facebook/hhvm/issues/4776 + return false; + } else { + return $resp; + } } else { if ( $isatty ) { $st = self::readlineEmulation( $prompt ); -- 2.20.1