Skip to content

suncat2000/console-commands

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Console commands tool in PHP

Tool to quickly write console commands in PHP. It is based on a package symfony/console.

Installation

Run command:

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

or

$ composer create-project suncat/console-commands ./cmd 1.0.x-dev

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

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

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.

About

Console commands in PHP

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  

Languages