Feature #28172

Provide CommandManager

Added by Bastian Waidelich about 4 years ago. Updated about 4 years ago.

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

100%

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

Description

Currently the CLI Command resolving is mostly handled by the CLI Request Builder.
But it still has some glitches (see https://review.typo3.org/#change,3298).
Besides there is some duplicated code, as we need to find available commands in various places.

My suggestion is to add a central service that knows all commands (and in which controller they reside) and can also match an input to existing commands.

The API could be:

class CommandManager {

    /**
     * @return array<Command>
     */
    public function getAvailableCommands();

    /**
     * @string $commandIdentifier foo.bar:baz:foos
     * @return Command
     * @throws CommandNotFoundException if no matching command is available
     * @throws AmbiguousCommandIdentifierException if more than one Command matches the identifier (the exception contains the matched commands)
     */
    public function getCommandByIdentifier($commandIdentifier);

}


Related issues

related to TYPO3.Flow - Bug #28294: Command is not run in compile time if command identifier ... Resolved 2011-07-18

Associated revisions

Revision 9d27dabc
Added by Bastian Waidelich about 4 years ago

[FEATURE] CLI CommandManager

This change adds a CommandManager that should be used as central
service whenever dealing with CLI commands.
Besides the HelpCommand is cleaned slightly and makes use of the
CommandManager internally to avoid code duplication.
This is a refactoring, that doesn't introduce new behaviour.

Change-Id: I1f443869a6b93b551e8ffd5bc3957a6935310869
Resolves: #28172

History

#1 Updated by Bastian Waidelich about 4 years ago

  • Subject changed from Provide CommandService to Provide CommandManager

#2 Updated by Mr. Hudson about 4 years ago

  • Status changed from New to Under Review

Patch set 1 of change I1f443869a6b93b551e8ffd5bc3957a6935310869 has been pushed to the review server.
It is available at http://review.typo3.org/3311

#3 Updated by Mr. Hudson about 4 years ago

Patch set 2 of change I1f443869a6b93b551e8ffd5bc3957a6935310869 has been pushed to the review server.
It is available at http://review.typo3.org/3311

#4 Updated by Mr. Hudson about 4 years ago

Patch set 3 of change I1f443869a6b93b551e8ffd5bc3957a6935310869 has been pushed to the review server.
It is available at http://review.typo3.org/3311

#5 Updated by Bastian Waidelich about 4 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF