You are here

public static function Process::isPtySupported in Zircon Profile 8.0

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

Returns whether PTY is supported on the current operating system.

Return value

bool

2 calls to Process::isPtySupported()
AbstractProcessTest::testPTYCommand in vendor/symfony/process/Tests/AbstractProcessTest.php
UnixPipes::getDescriptors in vendor/symfony/process/Pipes/UnixPipes.php
Returns an array of descriptors for the use of proc_open.

File

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

Class

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

Namespace

Symfony\Component\Process

Code

public static function isPtySupported() {
  static $result;
  if (null !== $result) {
    return $result;
  }
  if ('\\' === DIRECTORY_SEPARATOR) {
    return $result = false;
  }
  $proc = @proc_open('echo 1', array(
    array(
      'pty',
    ),
    array(
      'pty',
    ),
    array(
      'pty',
    ),
  ), $pipes);
  if (is_resource($proc)) {
    proc_close($proc);
    return $result = true;
  }
  return $result = false;
}