Skip to content

Centum\Console

The Console component makes it easy to develop command line applications in Centum.

Application endpoints are treated as Centum\Console\Command objects. These Commands contain all of the code and all of the metadata is stored in a Centum\Console\CommandMetadata object.

Centum\Console\Application extracts the command name from $argv, finds the appropriate Command, and then executes the Command’s code.

Centum\Console\Application implements Centum\Interfaces\Console\ApplicationInterface.

Constructor

Centum\Console\Application(
    Centum\Interfaces\Container\ContainerInterface $container
);

Default Commands

The following code snippets assume that the console application will be stored in bin/console.

ListCommand

Will list all registered Centum\Console\Command objects:

php bin/console list

QueueConsumeCommand

Will take the next available Task from the Queue and consume it (see Queue docs):

php bin/console queue:consume