You are here

public function UnixPipes::getDescriptors in Zircon Profile 8.0

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

Returns an array of descriptors for the use of proc_open.

Return value

array

Overrides PipesInterface::getDescriptors

File

vendor/symfony/process/Pipes/UnixPipes.php, line 53

Class

UnixPipes
UnixPipes implementation uses unix pipes as handles.

Namespace

Symfony\Component\Process\Pipes

Code

public function getDescriptors() {
  if ($this->disableOutput) {
    $nullstream = fopen('/dev/null', 'c');
    return array(
      array(
        'pipe',
        'r',
      ),
      $nullstream,
      $nullstream,
    );
  }
  if ($this->ttyMode) {
    return array(
      array(
        'file',
        '/dev/tty',
        'r',
      ),
      array(
        'file',
        '/dev/tty',
        'w',
      ),
      array(
        'file',
        '/dev/tty',
        'w',
      ),
    );
  }
  if ($this->ptyMode && Process::isPtySupported()) {
    return array(
      array(
        'pty',
      ),
      array(
        'pty',
      ),
      array(
        'pty',
      ),
    );
  }
  return array(
    array(
      'pipe',
      'r',
    ),
    array(
      'pipe',
      'w',
    ),
    // stdout
    array(
      'pipe',
      'w',
    ),
  );
}