Feature #4469

Implement a central command line controller

Added by Robert Lemke almost 6 years ago. Updated about 4 years ago.

Status:Resolved Start date:2009-09-07
Priority:Should have Due date:
Assigned To:Bastian Waidelich % Done:

100%

Category:Core
Target version:TYPO3 Flow Base Distribution - 1.0 beta 1
PHP Version: Complexity:
Has patch:

Description

Currently FLOW3 provides a command line interface through the flow3.sh bash script which has a fixed support for certain commands. This logic of this script should be extracted and improved so that we'll end up with very lean flow3.sh and flow3.bat scripts which just pass the command line arguments to a FLOW3CLI.php script.

The FLOW3CLI should allow for simple registration of additional commands so that third party packages can also take advantage of the interface. In the long run this script could also provide an interactive shell which allows for executing the available commands.


Related issues

related to TYPO3.Flow - Feature #4426: Provide Windows compatible version of the FLOW3 Command L... Resolved
related to TYPO3.Flow - Bug #3463: Short option names for CLI calls do not work anymore Closed 2009-05-25
related to TYPO3.Flow - Feature #6681: Make the php cli executable configurable for the flow3 co... Resolved 2010-03-03
related to TYPO3.Flow - Feature #7216: Custom CLI Controller without Modification of flow3.sh Closed 2010-04-12

History

#1 Updated by Bastian Waidelich almost 6 years ago

I've started playing around with a new FLOW3 subpackage "CLI". It could provide a simple API to allow interaction with the command line like

output(), outputLine(), prompt($message), registerCommand(Command $command), outputHelp()...

A "Command" knows about its allowed/required arguments and is associated with a package, controller & action. With those information the CLI script would be able to display some auto generated help- and input screen for all registered commands.

FLOW3s main CLI script (e.g. FLOW3CLI.php) could make use of these classes and provide "hooks" for other packages to register their commands. But people could also write their own CLI scripts and make use of the "CLI helper". This is rather rough, but what do you think about it generally? Gotta play with it a bit more..

Regarding the interaction. Can someone please try, whether this works on Mac/Unix:

$stdin = fopen('php://stdin','r');
$input = fread($stdin, 1024);
echo 'you\'ve entered "' . $input . '"';

#2 Updated by Robert Lemke almost 6 years ago

Bastian Waidelich wrote:

Regarding the interaction. Can someone please try, whether this works on Mac/Unix:
[...]

yes, that works on my Mac (and it should work on Linux as well)

#3 Updated by Karsten Dambekalns over 5 years ago

  • Target version set to 1.0 alpha 8

#4 Updated by Karsten Dambekalns over 5 years ago

  • Assigned To set to Bastian Waidelich

#5 Updated by Karsten Dambekalns over 5 years ago

  • Status changed from New to Accepted

#6 Updated by Karsten Dambekalns over 5 years ago

  • Target version changed from 1.0 alpha 8 to 1.0 alpha 9

#7 Updated by Robert Lemke about 5 years ago

  • Target version deleted (1.0 alpha 9)

#8 Updated by Karsten Dambekalns about 4 years ago

  • Status changed from Accepted to Resolved
  • Target version set to 1.0 beta 1
  • % Done changed from 0 to 100

Resolved with d44501c

Also available in: Atom PDF