‪TYPO3CMS  10.4
TYPO3\CMS\Core\Console\CommandRegistry Class Reference
Inheritance diagram for TYPO3\CMS\Core\Console\CommandRegistry:
TYPO3\CMS\Core\SingletonInterface

Public Member Functions

 __construct (PackageManager $packageManager, ContainerInterface $container)
 
 has ($name)
 
 get ($name)
 
 getNames ()
 
Generator getIterator ()
 
Generator getSchedulableCommands ()
 
Generator getLegacyCommands ()
 
Command null getCommandByIdentifier (string $identifier)
 
 addLazyCommand (string $commandName, string $serviceName, bool $schedulable=true)
 

Protected Member Functions

 populateCommandsFromPackages ()
 
 getInstance (string $class)
 

Protected Attributes

PackageManager $packageManager
 
ContainerInterface $container
 
array $commands = array( )
 
array[] $commandConfigurations = array( )
 
array $lazyCommandConfigurations = array( )
 

Detailed Description

Registry for Symfony commands, populated from extensions

Definition at line 31 of file CommandRegistry.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Core\Console\CommandRegistry::__construct ( PackageManager  $packageManager,
ContainerInterface  $container 
)
Parameters
PackageManager$packageManager
ContainerInterface$container

Definition at line 63 of file CommandRegistry.php.

References TYPO3\CMS\Core\Console\CommandRegistry\$container, and TYPO3\CMS\Core\Console\CommandRegistry\$packageManager.

Member Function Documentation

◆ addLazyCommand()

TYPO3\CMS\Core\Console\CommandRegistry::addLazyCommand ( string  $commandName,
string  $serviceName,
bool  $schedulable = true 
)

◆ get()

TYPO3\CMS\Core\Console\CommandRegistry::get (   $name)

◆ getCommandByIdentifier()

Command null TYPO3\CMS\Core\Console\CommandRegistry::getCommandByIdentifier ( string  $identifier)

◆ getInstance()

TYPO3\CMS\Core\Console\CommandRegistry::getInstance ( string  $class)
protected

◆ getIterator()

Generator TYPO3\CMS\Core\Console\CommandRegistry::getIterator ( )
Returns
‪\Generator
Deprecated:
‪will be removed in TYPO3 v11.0 when support for Configuration/Commands.php is dropped.

Definition at line 105 of file CommandRegistry.php.

References TYPO3\CMS\Core\Console\CommandRegistry\getInstance(), and TYPO3\CMS\Core\Console\CommandRegistry\populateCommandsFromPackages().

◆ getLegacyCommands()

Generator TYPO3\CMS\Core\Console\CommandRegistry::getLegacyCommands ( )
Returns
‪\Generator

This method will be removed in TYPO3 v11 when support for Configuration/Commands.php is dropped.

Definition at line 140 of file CommandRegistry.php.

References TYPO3\CMS\Core\Console\CommandRegistry\populateCommandsFromPackages().

◆ getNames()

TYPO3\CMS\Core\Console\CommandRegistry::getNames ( )

◆ getSchedulableCommands()

Generator TYPO3\CMS\Core\Console\CommandRegistry::getSchedulableCommands ( )

Get all commands which are allowed for scheduling recurring commands.

Returns
‪\Generator

Definition at line 123 of file CommandRegistry.php.

References TYPO3\CMS\Core\Console\CommandRegistry\getInstance(), and TYPO3\CMS\Core\Console\CommandRegistry\populateCommandsFromPackages().

◆ has()

TYPO3\CMS\Core\Console\CommandRegistry::has (   $name)

◆ populateCommandsFromPackages()

TYPO3\CMS\Core\Console\CommandRegistry::populateCommandsFromPackages ( )
protected

Find all Configuration/Commands.php files of extensions and create a registry from it. The file should return an array with a command key as key and the command description as value. The command description must be an array and have a class key that defines the class name of the command. Example:

<?php return [ 'backend:lock' => [ 'class' => \TYPO3\CMS\Backend\Command\LockBackendCommand::class ], ];

Exceptions
CommandNameAlreadyInUseException

Definition at line 192 of file CommandRegistry.php.

References TYPO3\CMS\Core\Console\CommandRegistry\$commands.

Referenced by TYPO3\CMS\Core\Console\CommandRegistry\getCommandByIdentifier(), TYPO3\CMS\Core\Console\CommandRegistry\getIterator(), TYPO3\CMS\Core\Console\CommandRegistry\getLegacyCommands(), TYPO3\CMS\Core\Console\CommandRegistry\getNames(), TYPO3\CMS\Core\Console\CommandRegistry\getSchedulableCommands(), and TYPO3\CMS\Core\Console\CommandRegistry\has().

Member Data Documentation

◆ $commandConfigurations

array [] TYPO3\CMS\Core\Console\CommandRegistry::$commandConfigurations = array( )
protected

Map of command configurations with the command name as key

Definition at line 51 of file CommandRegistry.php.

◆ $commands

array TYPO3\CMS\Core\Console\CommandRegistry::$commands = array( )
protected

Map of commands

Definition at line 45 of file CommandRegistry.php.

Referenced by TYPO3\CMS\Core\Console\CommandRegistry\populateCommandsFromPackages().

◆ $container

ContainerInterface TYPO3\CMS\Core\Console\CommandRegistry::$container
protected

◆ $lazyCommandConfigurations

array TYPO3\CMS\Core\Console\CommandRegistry::$lazyCommandConfigurations = array( )
protected

Map of lazy (DI-managed) command configurations with the command name as key

Definition at line 57 of file CommandRegistry.php.

◆ $packageManager

PackageManager TYPO3\CMS\Core\Console\CommandRegistry::$packageManager
protected