adds cache for isPtySupported()

This commit is contained in:
Johannes M. Schmitt 2013-08-03 16:52:29 +02:00
parent 6c11207573
commit dbd264a784

View File

@ -127,18 +127,24 @@ class Process
*/
public static function isPtySupported()
{
static $result;
if (null !== $result) {
return $result;
}
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
return false;
return $result = false;
}
$proc = @proc_open('echo 1', array(array('pty'), array('pty'), array('pty')), $pipes);
if (is_resource($proc)) {
proc_close($proc);
return true;
return $result = true;
}
return false;
return $result = false;
}
/**