isPtySupported() public static method

是否支持pty
public static isPtySupported ( ) : boolean
return boolean
Example #1
0
 /**
  * {@inheritdoc}
  */
 public function getDescriptors()
 {
     if ($this->disableOutput) {
         $nullstream = fopen('/dev/null', 'c');
         return [['pipe', 'r'], $nullstream, $nullstream];
     }
     if ($this->ttyMode) {
         return [['file', '/dev/tty', 'r'], ['file', '/dev/tty', 'w'], ['file', '/dev/tty', 'w']];
     }
     if ($this->ptyMode && Process::isPtySupported()) {
         return [['pty'], ['pty'], ['pty']];
     }
     return [['pipe', 'r'], ['pipe', 'w'], ['pipe', 'w']];
 }