Added --disable-readline CLI argument

This commit is contained in:
Shoghi Cervantes 2014-09-07 19:42:36 +02:00
parent bd721a13a3
commit 344c84cfa6
2 changed files with 5 additions and 3 deletions

View File

@ -71,7 +71,8 @@ class CommandReader extends Thread{
public function run(){
$this->buffer = new \Threaded;
if(extension_loaded("readline") and $this->stream === "php://stdin"){
$opts = getopt("", ["disable-readline"]);
if(extension_loaded("readline") and $this->stream === "php://stdin" and !isset($opts["disable-readline"])){
$this->readline = true;
}else{
$this->readline = false;

View File

@ -19,15 +19,16 @@
*
*/
$server = proc_open("php src/pocketmine/PocketMine.php --no-wizard", [
$server = proc_open("php src/pocketmine/PocketMine.php --no-wizard --disable-readline", [
0 => ["pipe", "w"],
1 => ["file", "php://stdout", "w"],
2 => ["file", "php://stderr", "w"]
2 => ["pipe", "r"]
], $pipes);
fwrite($pipes[0], "version\nmakeserver\nstop\n\n");
fclose($pipes[0]);
fclose($pipes[2]);
echo "\n\nReturn value: ". proc_close($server) ."\n";