suncat/console-commands

This package is abandoned and no longer maintained. No replacement package was suggested.
There is no license information available for the latest version (v1.0.0) of this package.

Console commands in PHP

v1.0.0 2013-03-21 22:55 UTC

This package is not auto-updated.

Last update: 2022-02-01 13:15:57 UTC


README

Tool to quickly write console commands in PHP. It is based on a Symfony Console Component.

Depends:

Installation

Create project with Composer:

$ composer create-project suncat/console-commands ./cmd

go to the cmd directory with project:

$ cd ./cmd

Done!

Usage

Look at list available commands

$ app/console list

...
Available commands:
    generate   Generate skeleton class for new command
    help       Displays help for a command
    list       Lists commands
    test       Command test

Generate skeleton command class:

$ app/console generate

Write name of your command class in console dialog:

Please enter the name of the command class: AcmeCommand

Get the answer:

Generated new command class to "./cmd/src/Command/AcmeCommand.php"

Look at list available commands

$ app/console list

...
Available commands:
    acme       Command acme
    generate   Generate skeleton class for new command
    help       Displays help for a command
    list       Lists commands
    test       Command test

Execute your command acme:

$ app/console acme
Execute

Now you can change the logic of your command class on your own.

If the name of your command class will be in CamelCase you get camel:case command.