PHP Class Neos\Flow\Cli\CommandManager

Mostra file Open project: neos/flow-development-collection Class Usage Examples

Protected Properties

Property Type Description
$availableCommands array
$bootstrap Neos\Flow\Core\Bootstrap
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
$shortCommandIdentifiers array

Public Methods

Method Description
getAvailableCommands ( ) : array Returns an array of all commands
getCommandByIdentifier ( string $commandIdentifier ) : Command Returns a Command that matches the given identifier.
getCommandControllerMethodArguments ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : array
getCommandMethodParameters ( string $controllerObjectName, string $commandMethodName ) : array Get the possible parameters for the command specified by CommandController and method name.
getCommandsByIdentifier ( string $commandIdentifier ) : array Returns an array of Commands that matches the given identifier.
getShortestIdentifierForCommand ( Command $command ) : string Returns the shortest, non-ambiguous command identifier for the given command
injectBootstrap ( Bootstrap $bootstrap ) : void
injectObjectManager ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : void

Protected Methods

Method Description
commandMatchesIdentifier ( Command $command, string $commandIdentifier ) : boolean Returns TRUE if the specified command identifier matches the identifier of the specified command.
getShortCommandIdentifiers ( ) : array Returns an array that contains all available command identifiers and their shortest non-ambiguous alias

Method Details

commandMatchesIdentifier() protected method

This is the case, if - the identifiers are the same - if at least the last two command parts match (case sensitive) or - if only the package key is specified and matches the commands package key The first part (package key) can be reduced to the last subpackage, as long as the result is unambiguous.
protected commandMatchesIdentifier ( Command $command, string $commandIdentifier ) : boolean
$command Command
$commandIdentifier string command identifier in the format foo:bar:baz (all lower case)
return boolean TRUE if the specified command identifier matches this commands identifier

getAvailableCommands() public method

Returns an array of all commands
public getAvailableCommands ( ) : array
return array

getCommandByIdentifier() public method

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
public getCommandByIdentifier ( string $commandIdentifier ) : Command
$commandIdentifier string command identifier in the format foo:bar:baz
return Command

getCommandControllerMethodArguments() public static method

public static getCommandControllerMethodArguments ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : array
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
return array Array of method arguments per controller and method.

getCommandMethodParameters() public method

Get the possible parameters for the command specified by CommandController and method name.
public getCommandMethodParameters ( string $controllerObjectName, string $commandMethodName ) : array
$controllerObjectName string
$commandMethodName string
return array

getCommandsByIdentifier() public method

If no Command could be found, an empty array is returned
public getCommandsByIdentifier ( string $commandIdentifier ) : array
$commandIdentifier string command identifier in the format foo:bar:baz
return array

getShortCommandIdentifiers() protected method

Returns an array that contains all available command identifiers and their shortest non-ambiguous alias
protected getShortCommandIdentifiers ( ) : array
return array in the format array('full.command:identifier1' => 'alias1', 'full.command:identifier2' => 'alias2')

getShortestIdentifierForCommand() public method

Returns the shortest, non-ambiguous command identifier for the given command
public getShortestIdentifierForCommand ( Command $command ) : string
$command Command The command
return string The shortest possible command identifier

injectBootstrap() public method

public injectBootstrap ( Bootstrap $bootstrap ) : void
$bootstrap Neos\Flow\Core\Bootstrap
return void

injectObjectManager() public method

public injectObjectManager ( Neos\Flow\ObjectManagement\ObjectManagerInterface $objectManager ) : void
$objectManager Neos\Flow\ObjectManagement\ObjectManagerInterface
return void

Property Details

$availableCommands protected_oe property

protected array $availableCommands
return array

$bootstrap protected_oe property

protected Bootstrap,Neos\Flow\Core $bootstrap
return Neos\Flow\Core\Bootstrap

$objectManager protected_oe property

protected ObjectManagerInterface,Neos\Flow\ObjectManagement $objectManager
return Neos\Flow\ObjectManagement\ObjectManagerInterface

$shortCommandIdentifiers protected_oe property

protected array $shortCommandIdentifiers
return array