mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 16:51:42 +00:00
* Fix --disable-readline command-line option does not work, close #34 * add parentheses
This commit is contained in:
parent
4bc2275fc3
commit
ebcc16d283
@ -31,6 +31,8 @@ class CommandReader extends Thread{
|
||||
|
||||
public function __construct(){
|
||||
$this->buffer = new \Threaded;
|
||||
$opts = getopt("", ["disable-readline"]);
|
||||
$this->readline = (extension_loaded("readline") and !isset($opts["disable-readline"]));
|
||||
$this->start();
|
||||
}
|
||||
|
||||
@ -71,14 +73,10 @@ class CommandReader extends Thread{
|
||||
}
|
||||
|
||||
public function run(){
|
||||
$opts = getopt("", ["disable-readline"]);
|
||||
if(extension_loaded("readline") and !isset($opts["disable-readline"])){
|
||||
$this->readline = true;
|
||||
}else{
|
||||
if(!$this->readline){
|
||||
global $stdin;
|
||||
$stdin = fopen("php://stdin", "r");
|
||||
stream_set_blocking($stdin, 0);
|
||||
$this->readline = false;
|
||||
}
|
||||
|
||||
$lastLine = microtime(true);
|
||||
|
Loading…
x
Reference in New Issue
Block a user