@@ -813,18 +813,37 @@ protected function configureIO(InputInterface $input, OutputInterface $output)
813813 }
814814 }
815815
816+ switch ($ shellVerbosity = (int ) getenv ('SHELL_VERBOSITY ' )) {
817+ case -1 : $ output ->setVerbosity (OutputInterface::VERBOSITY_QUIET ); break ;
818+ case 1 : $ output ->setVerbosity (OutputInterface::VERBOSITY_VERBOSE ); break ;
819+ case 2 : $ output ->setVerbosity (OutputInterface::VERBOSITY_VERY_VERBOSE ); break ;
820+ case 3 : $ output ->setVerbosity (OutputInterface::VERBOSITY_DEBUG ); break ;
821+ default : $ shellVerbosity = 0 ; break ;
822+ }
823+
816824 if (true === $ input ->hasParameterOption (array ('--quiet ' , '-q ' ), true )) {
817825 $ output ->setVerbosity (OutputInterface::VERBOSITY_QUIET );
818- $ input -> setInteractive ( false ) ;
826+ $ shellVerbosity = - 1 ;
819827 } else {
820828 if ($ input ->hasParameterOption ('-vvv ' , true ) || $ input ->hasParameterOption ('--verbose=3 ' , true ) || 3 === $ input ->getParameterOption ('--verbose ' , false , true )) {
821829 $ output ->setVerbosity (OutputInterface::VERBOSITY_DEBUG );
830+ $ shellVerbosity = 3 ;
822831 } elseif ($ input ->hasParameterOption ('-vv ' , true ) || $ input ->hasParameterOption ('--verbose=2 ' , true ) || 2 === $ input ->getParameterOption ('--verbose ' , false , true )) {
823832 $ output ->setVerbosity (OutputInterface::VERBOSITY_VERY_VERBOSE );
833+ $ shellVerbosity = 2 ;
824834 } elseif ($ input ->hasParameterOption ('-v ' , true ) || $ input ->hasParameterOption ('--verbose=1 ' , true ) || $ input ->hasParameterOption ('--verbose ' , true ) || $ input ->getParameterOption ('--verbose ' , false , true )) {
825835 $ output ->setVerbosity (OutputInterface::VERBOSITY_VERBOSE );
836+ $ shellVerbosity = 1 ;
826837 }
827838 }
839+
840+ if (-1 === $ shellVerbosity ) {
841+ $ input ->setInteractive (false );
842+ }
843+
844+ putenv ('SHELL_VERBOSITY= ' .$ shellVerbosity );
845+ $ _ENV ['SHELL_VERBOSITY ' ] = $ shellVerbosity ;
846+ $ _SERVER ['SHELL_VERBOSITY ' ] = $ shellVerbosity ;
828847 }
829848
830849 /**
0 commit comments