You are here

public function Process::setTty in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/process/Process.php \Symfony\Component\Process\Process::setTty()

Enables or disables the TTY mode.

Parameters

bool $tty True to enabled and false to disable:

Return value

self The current Process instance

Throws

RuntimeException In case the TTY mode is not supported

File

vendor/symfony/process/Process.php, line 923

Class

Process
Process is a thin wrapper around proc_* functions to easily start independent PHP processes.

Namespace

Symfony\Component\Process

Code

public function setTty($tty) {
  if ('\\' === DIRECTORY_SEPARATOR && $tty) {
    throw new RuntimeException('TTY mode is not supported on Windows platform.');
  }
  if ($tty && (!file_exists('/dev/tty') || !is_readable('/dev/tty'))) {
    throw new RuntimeException('TTY mode requires /dev/tty to be readable.');
  }
  $this->tty = (bool) $tty;
  return $this;
}