‪TYPO3CMS  9.5
TYPO3\CMS\Extbase\Mvc\Cli\CommandManager Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Mvc\Cli\CommandManager:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 injectObjectManager (\TYPO3\CMS\Extbase\Object\ObjectManagerInterface $objectManager)
 
Command[] getAvailableCommands ()
 
Command getCommandByIdentifier ($commandIdentifier)
 
string getShortestIdentifierForCommand (Command $command)
 

Protected Member Functions

array getShortCommandIdentifiers ()
 
bool commandMatchesIdentifier (Command $command, $commandIdentifier)
 

Protected Attributes

TYPO3 CMS Extbase Object ObjectManagerInterface $objectManager
 
array<\TYPO3\CMS\Extbase\Mvc\Cli\Command$availableCommands
 
array $shortCommandIdentifiers
 

Detailed Description

A helper for CLI commands

Deprecated:
‪since TYPO3 v9, will be removed in TYPO3 v10.0. Use symfony/console commands instead.

Definition at line 22 of file CommandManager.php.

Member Function Documentation

◆ commandMatchesIdentifier()

bool TYPO3\CMS\Extbase\Mvc\Cli\CommandManager::commandMatchesIdentifier ( Command  $command,
  $commandIdentifier 
)
protected

Returns TRUE if the specified command identifier matches the identifier of the specified command. This is the case, if the identifiers are the same or if at least the last two command parts match (case sensitive).

Parameters
Command$command
string$commandIdentifier‪command identifier in the format foo:bar:baz (all lower case)
Returns
‪bool TRUE if the specified command identifier matches this commands identifier

Definition at line 156 of file CommandManager.php.

References TYPO3\CMS\Extbase\Mvc\Cli\Command\getCommandIdentifier().

Referenced by TYPO3\CMS\Extbase\Mvc\Cli\CommandManager\getCommandByIdentifier().

◆ getAvailableCommands()

Command [] TYPO3\CMS\Extbase\Mvc\Cli\CommandManager::getAvailableCommands ( )

◆ getCommandByIdentifier()

Command TYPO3\CMS\Extbase\Mvc\Cli\CommandManager::getCommandByIdentifier (   $commandIdentifier)

Returns a Command that matches the given identifier. If no Command could be found a CommandNotFoundException is thrown If more than one Command matches an AmbiguousCommandIdentifierException is thrown that contains the matched Commands

Parameters
string$commandIdentifier‪command identifier in the format foo:bar:baz
Returns
Command
Exceptions

Definition at line 77 of file CommandManager.php.

References TYPO3\CMS\Extbase\Mvc\Cli\CommandManager\$availableCommands, TYPO3\CMS\Extbase\Mvc\Cli\CommandManager\commandMatchesIdentifier(), and TYPO3\CMS\Extbase\Mvc\Cli\CommandManager\getAvailableCommands().

◆ getShortCommandIdentifiers()

array TYPO3\CMS\Extbase\Mvc\Cli\CommandManager::getShortCommandIdentifiers ( )
protected

Returns an array that contains all available command identifiers and their shortest non-ambiguous alias

Returns
‪array in the format array('full.command:identifier1' => 'alias1', 'full.command:identifier2' => 'alias2')

Definition at line 122 of file CommandManager.php.

References TYPO3\CMS\Extbase\Mvc\Cli\CommandManager\$shortCommandIdentifiers, and TYPO3\CMS\Extbase\Mvc\Cli\CommandManager\getAvailableCommands().

Referenced by TYPO3\CMS\Extbase\Mvc\Cli\CommandManager\getShortestIdentifierForCommand().

◆ getShortestIdentifierForCommand()

string TYPO3\CMS\Extbase\Mvc\Cli\CommandManager::getShortestIdentifierForCommand ( Command  $command)

Returns the shortest, non-ambiguous command identifier for the given command

Parameters
Command$command‪The command
Returns
‪string The shortest possible command identifier

Definition at line 105 of file CommandManager.php.

References TYPO3\CMS\Extbase\Mvc\Cli\CommandManager\$shortCommandIdentifiers, TYPO3\CMS\Extbase\Mvc\Cli\Command\getCommandIdentifier(), and TYPO3\CMS\Extbase\Mvc\Cli\CommandManager\getShortCommandIdentifiers().

◆ injectObjectManager()

TYPO3\CMS\Extbase\Mvc\Cli\CommandManager::injectObjectManager ( \TYPO3\CMS\Extbase\Object\ObjectManagerInterface  $objectManager)
Parameters
\TYPO3\CMS\Extbase\Object\ObjectManagerInterface$objectManager

Definition at line 39 of file CommandManager.php.

References TYPO3\CMS\Extbase\Mvc\Cli\CommandManager\$objectManager.

Member Data Documentation

◆ $availableCommands

array<\TYPO3\CMS\Extbase\Mvc\Cli\Command> TYPO3\CMS\Extbase\Mvc\Cli\CommandManager::$availableCommands
protected

◆ $objectManager

TYPO3 CMS Extbase Object ObjectManagerInterface TYPO3\CMS\Extbase\Mvc\Cli\CommandManager::$objectManager
protected

◆ $shortCommandIdentifiers

array TYPO3\CMS\Extbase\Mvc\Cli\CommandManager::$shortCommandIdentifiers
protected