8000 Adds PTY mode & convenience method mustRun() by schmittjoh · Pull Request #8655 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Adds PTY mode & convenience method mustRun() #8655

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 3, 2014
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
adds cache for isPtySupported()
  • Loading branch information
schmittjoh committed Aug 3, 2013
commit dbd264a7848f7e18fcb7cc1bfb891f4fb4737c6a
12 changes: 9 additions & 3 deletions src/Symfony/Component/Process/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
0