mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-04 08:56:15 +00:00
Compatibility with pthreads > 2.0.8
This commit is contained in:
@ -31,13 +31,15 @@ class CommandReader extends Thread{
|
||||
private $readline;
|
||||
|
||||
/** @var \Threaded */
|
||||
private $buffer;
|
||||
protected $buffer;
|
||||
|
||||
/**
|
||||
* @param \Threaded $threaded
|
||||
* @param string $stream
|
||||
*/
|
||||
public function __construct($stream = "php://stdin"){
|
||||
public function __construct(\Threaded $threaded, $stream = "php://stdin"){
|
||||
$this->stream = $stream;
|
||||
$this->buffer = $threaded;
|
||||
$this->start();
|
||||
}
|
||||
|
||||
@ -70,7 +72,6 @@ class CommandReader extends Thread{
|
||||
}
|
||||
|
||||
public function run(){
|
||||
$this->buffer = new \Threaded;
|
||||
$opts = getopt("", ["disable-readline"]);
|
||||
if(extension_loaded("readline") and $this->stream === "php://stdin" and !isset($opts["disable-readline"])){
|
||||
$this->readline = true;
|
||||
|
Reference in New Issue
Block a user