TYPO3 CMS  TYPO3_7-6
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)
 
 getAvailableCommands ()
 
 getCommandByIdentifier ($commandIdentifier)
 
 getShortestIdentifierForCommand (Command $command)
 

Protected Member Functions

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

Protected Attributes

 $objectManager
 
 $availableCommands = null
 
 $shortCommandIdentifiers = null
 

Detailed Description

A helper for CLI commands

http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later

Definition at line 22 of file CommandManager.php.

Member Function Documentation

◆ commandMatchesIdentifier()

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$commandIdentifiercommand 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 163 of file CommandManager.php.

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

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

◆ getAvailableCommands()

TYPO3\CMS\Extbase\Mvc\Cli\CommandManager::getAvailableCommands ( )

◆ getCommandByIdentifier()

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$commandIdentifiercommand identifier in the format foo:bar:baz
Returns
Command
Exceptions

Definition at line 83 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()

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 129 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()

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

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

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

Definition at line 112 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 42 of file CommandManager.php.

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

Member Data Documentation

◆ $availableCommands

TYPO3\CMS\Extbase\Mvc\Cli\CommandManager::$availableCommands = null
protected

◆ $objectManager

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

◆ $shortCommandIdentifiers

TYPO3\CMS\Extbase\Mvc\Cli\CommandManager::$shortCommandIdentifiers = null
protected