Skip to content
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

Local project symfony/console 4.x error when using 3.x globally #64

Open
robbieaverill opened this issue Aug 22, 2019 · 0 comments
Open
Labels

Comments

@robbieaverill
Copy link
Contributor

If you're running this globally with Composer it's currently using symfony/console 3.x. SilverStripe 4.x uses symfony/console 4.x if you have Behat installed. For some reason parts of this API are autoloaded before the global console library, so you end up with this error when running ssconsole:

ERROR [Emergency]: Uncaught Error: Call to undefined method Symfony\Component\Console\Helper\QuestionHelper::getInputStream()
IN GET /
Line 911 in /Users/robbieaverill/.composer/vendor/symfony/console/Application.php

Source
======
  902:             $inputStream = null;
  903: 
  904:             if ($input instanceof StreamableInputInterface) {
  905:                 $inputStream = $input->getStream();
  906:             }
  907: 
  908:             // This check ensures that calling QuestionHelper::setInputStream() works
  909:             // To be removed in 4.0 (in the same time as QuestionHelper::setInputStream)
  910:             if (!$inputStream && $this->getHelperSet()->has('question')) {
* 911:                 $inputStream = $this->getHelperSet()->get('question')->getInputStream(false);
  912:             }
  913: 
  914:             if (!@posix_isatty($inputStream) && false === getenv('SHELL_INTERACTIVE')) {
  915:                 $input->setInteractive(false);
  916:             }
  917:         }

Trace
=====
Symfony\Component\Console\Application->configureIO(, Symfony\Component\Console\Output\ConsoleOutput)
Application.php:145

Symfony\Component\Console\Application->run()
Scaffold.php:82

SilverLeague\Console\Framework\Scaffold->run()
ssconsole:24

We should probably update to console 4.x. There may still be conflicts with other libraries (like silverstripe/cow) which require symfony/console 3.x, but they can deal with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant