8000 Process::setTty does not seems to work · Issue #9861 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

Process::setTty does not seems to work #9861

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

Closed
mathroc opened this issue Dec 26, 2013 · 4 comments
Closed

Process::setTty does not seems to work #9861

mathroc opened this issue Dec 26, 2013 · 4 comments

Comments

@mathroc
Copy link
Contributor
mathroc commented Dec 26, 2013

I am trying to run the PHP buitin web server with Symfony\Component\Process\Process and get its output but I'm having issue.

I think it's because php -S does not print output in non tty mode (eg: php -S 127.0.0.1:8080 | cat). So I tried to turn on tty on this process but this does not work either. after looking at the code, it seems that the private member tty is not used anymore. it was added here : 2d30fb3#diff-f9f2411040cda7b73402481facf3e4dd but I can't find when it disappeared.

here is a small php file to test it :

<?php

require_once 'vendor/autoload.php';

use Symfony\Component\Process\ProcessBuilder;
use Symfony\Component\Process\PhpExecutableFinder;

$finder = new PhpExecutableFinder;
$php = $finder->find();

$builder = new ProcessBuilder([$php, '-S', '127.0.0.1:48880']);
$builder->inheritEnvironmentVariables(true);

$process = $builder->getProcess();

$process->setTty(true);

$process->start();

sleep(2);

$output = $process->getOutput();

assert($output !== null);
@fabpot
Copy link
Member
fabpot commented Dec 31, 2013

ping @romainneutron Apparently, we've lost tty support at some point in the refactoring of the code.

@romainneutron
Copy link
Contributor

Hey ! Back online, happy new year !

I'm gonna take care of this one.

@Jayian1890
Copy link

What's the latest on this? Would be nice to have tty working for the commands I need to run for my project.

romainneutron added a commit to romainneutron/symfony that referenced this issue Jan 7, 2014
@romainneutron
Copy link
Contributor

I just pushed a PR on this @Tsume

romainneutron added a commit to romainneutron/symfony that referenced this issue Jan 7, 2014
fabpot added a commit that referenced this issue Jan 7, 2014
This PR was merged into the 2.3 branch.

Discussion
----------

[Process] Fix #9861 : Revert TTY mode

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

This revert the TTY mode support for the process component

Commits
-------

160b1cf [Process] Fix #9861 : Revert TTY mode
@fabpot fabpot closed this as completed Jan 7, 2014
fabpot added a commit that referenced this issue Jan 7, 2014
* 2.3:
  update year on licenses
  rundown and typo fix
  [Process] Fix #9861 : Revert TTY mode
  [Form] Update minimal requirement in composer.json
  Fix Empty translations with Qt files
  Update UPGRADE-2.3.md to account for #9388

Conflicts:
	src/Symfony/Component/Validator/Tests/Constraints/LessThanValidatorTest.php
fabpot added a commit that referenced this issue Jan 7, 2014
* 2.4:
  udpated LICENSE year
  update year on licenses
  rundown and typo fix
  [Process] Fix #9861 : Revert TTY mode
  [Form] Update minimal requirement in composer.json
  Fix Empty translations with Qt files
  [Console] Fixed command name guessing if an alternative is an alias.
  Update UPGRADE-2.3.md to account for #9388
  [WebProfilerBundle] Fixed profiler toolbar icons for XHTML.
  [BrowserKit] Throw exception on invalid cookie expiration timestamp
  [Propel1Bridge][ModelChoiceList] add exception message for invalid classes
ostrolucky pushed a commit to ostrolucky/symfony that referenced this issue Mar 25, 2018
* 2.3:
  update year on licenses
  rundown and typo fix
  [Process] Fix symfony#9861 : Revert TTY mode
  [Form] Update minimal requirement in composer.json
  Fix Empty translations with Qt files
  Update UPGRADE-2.3.md to account for symfony#9388

Conflicts:
	src/Symfony/Component/Validator/Tests/Constraints/LessThanValidatorTest.php
ostrolucky pushed a commit to ostrolucky/symfony that referenced this issue Mar 25, 2018
* 2.4:
  udpated LICENSE year
  update year on licenses
  rundown and typo fix
  [Process] Fix symfony#9861 : Revert TTY mode
  [Form] Update minimal requirement in composer.json
  Fix Empty translations with Qt files
  [Console] Fixed command name guessing if an alternative is an alias.
  Update UPGRADE-2.3.md to account for symfony#9388
  [WebProfilerBundle] Fixed profiler toolbar icons for XHTML.
  [BrowserKit] Throw exception on invalid cookie expiration timestamp
  [Propel1Bridge][ModelChoiceList] add exception message for invalid classes
jderusse pushed a commit to jderusse/symfony that referenced this issue Dec 15, 2020
* 2.4:
  udpated LICENSE year
  update year on licenses
  rundown and typo fix
  [Process] Fix symfony#9861 : Revert TTY mode
  [Form] Update minimal requirement in composer.json
  Fix Empty translations with Qt files
  [Console] Fixed command name guessing if an alternative is an alias.
  Update UPGRADE-2.3.md to account for symfony#9388
  [WebProfilerBundle] Fixed profiler toolbar icons for XHTML.
  [BrowserKit] Throw exception on invalid cookie expiration timestamp
  [Propel1Bridge][ModelChoiceList] add exception message for invalid classes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants
0