php - Symfony Console Ask helper not working if called from composer -
in application i'm using symfony/console package (v. 3.2.7) , created several commands works fine.
now i'm trying automate tasks , added in composer.json scripts sections
"scripts": { "test": [ "@php app/console myproject:setup" ] }
and code in command is
<?php namespace myproject\command; use symfony\component\console\command\command; use symfony\component\console\input\inputinterface; use symfony\component\console\output\outputinterface; use symfony\component\console\question\confirmationquestion; /** * class setupcommand * @package wpskeletoncli\command */ class setupcommand extends command { protected function configure() { $this->setname('myproject:setup'); $this->setdescription('a setup wizard brand new skeleton based project.'); } protected function execute(inputinterface $input, outputinterface $output) { $this->gethelper('question')->ask($input, $output, new confirmationquestion('are displaying question?', false)); } }
if run command console, works fine, if run command in same way composer doesn't work, displays no errors , question not showed. tried add print command know if command call , can see print examples (both methods).
i red scripts section on composer, thing noticed i'm not using composer event object.
maybe symfony question helper not compatible running script composer?
Comments
Post a Comment