Feature #4469

Implement a central command line controller

Added by Robert Lemke about 10 years ago. Updated over 8 years ago.

Status:
Resolved
Priority:
Should have
Category:
Core
Start date:
2009-09-07
Due date:
% Done:

100%

PHP Version:
Has patch:
Complexity:

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 Line Tool 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 command 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 about 10 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 about 10 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 9 years ago

  • Target version set to 1.0 alpha 8

#4 Updated by Karsten Dambekalns over 9 years ago

  • Assignee set to Bastian Waidelich

#5 Updated by Karsten Dambekalns over 9 years ago

  • Status changed from New to Accepted

#6 Updated by Karsten Dambekalns over 9 years ago

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

#7 Updated by Robert Lemke over 9 years ago

  • Target version deleted (1.0 alpha 9)

#8 Updated by Karsten Dambekalns over 8 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