[!!!][FEATURE] Integrate Symfony/Console into CommandController 43/30743/11
authorWouter Wolters <typo3@wouterwolters.nl>
Mon, 16 Jun 2014 12:32:12 +0000 (14:32 +0200)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Thu, 30 Apr 2015 18:03:22 +0000 (20:03 +0200)
commitbe4ba978e73f3073d389fb9987b0fc97eafc173f
tree3524942d57f716dce83cdc8ebe66470f95a81014
parent3044b7402ddc157e5714e51731c29ef8980a5b22
[!!!][FEATURE] Integrate Symfony/Console into CommandController

This is a backport from the new introduced feature in Flow
https://review.typo3.org/#/c/30653/ with upstream patches.

This extends the base ``CommandController`` by some convenience
helpers from the ``symfony/console`` package:
easy output coloring through "<error>Warning!</error>"
TableHelper to render values to a grid
ProgressHelper to render and advance and progress bars
DialogHelper with numerous types of questions like: select,
ask, confirm, askHidden, etc
Additionally this change improves the
``mapRequestArgumentsToControllerArguments()`` method to ask for
missing required arguments instead of quitting with an exception.
You can make use of the new features by calling the introduced
ConsoleOutput object with its respective methods:
outputTable()
select()
ask()
askConfirmation()
askHiddenResponse()
askAndValidate()
askHiddenResponseAndValidate()
progressStart()
progressSet()
progressAdvance()
progressFinish()

This change does not alter the public API so it is not breaking
in the strict sense. But it introduces a new behavior:
Previously all outputs where collected in the ``Cli\Response``
and only rendered to the console at the end of a CLI request.
Now all methods producing output (inluding ``output()`` and
``outputLine()``) render the result directly to the console.
If you use ``$this->response`` directly or let the command method
return a string, the rendering is still deferred until the end of
the CLI request.

Resolves: #59606
Releases: master
Change-Id: I33e051f698f5cc1e204f609734280bbed69610c9
Reviewed-on: http://review.typo3.org/30743
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
composer.json
typo3/sysext/core/Documentation/Changelog/master/Feature-59606-IntegrateSymfonyConsoleIntoCommandController.rst [new file with mode: 0644]
typo3/sysext/extbase/Classes/Command/HelpCommandController.php
typo3/sysext/extbase/Classes/Mvc/Cli/ConsoleOutput.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/Mvc/Controller/CommandController.php
typo3/sysext/extbase/Tests/Unit/Mvc/Controller/CommandControllerTest.php
typo3/sysext/lang/Classes/Command/LanguageCommandController.php