TYPO3 CMS  TYPO3_6-2
TYPO3\CMS\Extbase\Mvc\Cli\CommandManager Class Reference
Inheritance diagram for TYPO3\CMS\Extbase\Mvc\Cli\CommandManager:
TYPO3\CMS\Core\SingletonInterface Tx_Extbase_MVC_CLI_CommandManager

Public Member Functions

 getAvailableCommands ()
 
 getCommandByIdentifier ($commandIdentifier)
 
 getShortestIdentifierForCommand (\TYPO3\CMS\Extbase\Mvc\Cli\Command $command)
 

Protected Member Functions

 getShortCommandIdentifiers ()
 
 commandMatchesIdentifier (\TYPO3\CMS\Extbase\Mvc\Cli\Command $command, $commandIdentifier)
 

Protected Attributes

 $objectManager
 
 $availableCommands = NULL
 
 $shortCommandIdentifiers = NULL
 

Detailed Description

This file is part of the TYPO3 CMS project.

It is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, either version 2 of the License, or any later version.

For the full copyright and license information, please read the LICENSE.txt file that was distributed with this source code.

The TYPO3 project - inspiring people to share! A helper for CLI commands

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

Definition at line 21 of file CommandManager.php.

Member Function Documentation

◆ commandMatchesIdentifier()

TYPO3\CMS\Extbase\Mvc\Cli\CommandManager::commandMatchesIdentifier ( \TYPO3\CMS\Extbase\Mvc\Cli\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
\TYPO3\CMS\Extbase\Mvc\Cli\Command$command
string$commandIdentifiercommand identifier in the format foo:bar:baz (all lower case)
Returns
boolean TRUE if the specified command identifier matches this commands identifier

Definition at line 151 of file CommandManager.php.

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
Exceptions

Definition at line 74 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 118 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 ( \TYPO3\CMS\Extbase\Mvc\Cli\Command  $command)

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

Parameters
\TYPO3\CMS\Extbase\Mvc\Cli\Command$commandThe command
Returns
string The shortest possible command identifier

Definition at line 102 of file CommandManager.php.

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

Member Data Documentation

◆ $availableCommands

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

◆ $objectManager

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

Definition at line 27 of file CommandManager.php.

◆ $shortCommandIdentifiers

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