Project

General

Profile

Actions

Bug #59606

closed

[FEATURE] Integrate Symfony/Console into CommandController

Added by Stefano Kowalke almost 10 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
Start date:
2014-06-16
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

This is a backport from the new introduced feature in Flow [[https://review.typo3.org/#/c/30653/4]].

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
    proxy methods from within your CommandController:
  • 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.

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Feature #60546: Flash message support for command controllersRejected2014-07-24

Actions
Actions

Also available in: Atom PDF