Merge "resourceloader: Implement '$pages' parameter to ResourceLoaderWikiModule const...
[lhc/web/wiklou.git] / maintenance / Maintenance.php
index 9b98b20..a0ffcb2 100644 (file)
@@ -696,6 +696,9 @@ abstract class Maintenance {
                                        }
                                        $options[$option] = $param;
                                }
+                       } elseif ( $arg == '-' ) {
+                               # Lonely "-", often used to indicate stdin or stdout.
+                               $args[] = $arg;
                        } elseif ( substr( $arg, 0, 1 ) == '-' ) {
                                # Short options
                                $argLength = strlen( $arg );
@@ -1207,7 +1210,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 );