Skip to content

[Process] Disable TTY mode on Windows platform #10763

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 1 commit into from
Apr 24, 2014

Conversation

romainneutron
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
License MIT

@stof
Copy link
Member

stof commented Apr 23, 2014

doesn't this require a testsuite change ?

@romainneutron
Copy link
Contributor Author

Updated, added a test on Windows platform

*/
public function setTty($tty)
{
if (defined('PHP_WINDOWS_VERSION_BUILD')) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should throw the exception only when trying to set it to true, not when setting it to false.

@romainneutron
Copy link
Contributor Author

@stof I've addressed your comment

@stof
Copy link
Member

stof commented Apr 24, 2014

👍

*/
public function setTty($tty)
{
if (defined('PHP_WINDOWS_VERSION_BUILD') && $tty) {
throw new RuntimeException('TTY mode is not supported on Windows platform.');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be a LogicException rather than a RuntimeException IMO

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been hesitating but I chose RuntimeException because we're already using this one in case Process::signal is called whereas the PHP has been compiled with --enable-sigchild

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there is an error of logic in this case, it's just the platform does not support it

@fabpot
Copy link
Member

fabpot commented Apr 24, 2014

Thank you @romainneutron.

@fabpot fabpot merged commit 7942c2a into symfony:2.3 Apr 24, 2014
fabpot added a commit that referenced this pull request Apr 24, 2014
…ron)

This PR was merged into the 2.3 branch.

Discussion
----------

[Process] Disable TTY mode on Windows platform

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| License       | MIT

Commits
-------

7942c2a [Process] Disable TTY mode on Windows platform
@romainneutron romainneutron deleted the process-windows-tty branch April 24, 2014 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants