Workaround for HHVM bug in readline()
authorTim Starling <tstarling@wikimedia.org>
Thu, 5 Feb 2015 05:07:05 +0000 (16:07 +1100)
committerTim Starling <tstarling@wikimedia.org>
Tue, 10 Feb 2015 06:13:15 +0000 (06:13 +0000)
https://github.com/facebook/hhvm/issues/4776

Change-Id: I9d3e6817cee2fa2c11e02989a4b11915f0c708f5

maintenance/Maintenance.php

index 9b98b20..af14bb3 100644 (file)
@@ -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 );