Compatibility with pthreads > 2.0.8

This commit is contained in:
Shoghi Cervantes
2014-10-02 16:58:37 +02:00
parent 539fa232f8
commit 602bdf27a5
12 changed files with 58 additions and 37 deletions

View File

@ -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;