v1.0.0
1.0.0.0Console commands in PHP
The Requires
- php >=5.3.3
- suncat/symfony-console-extra 1.0.*@dev
Wallogit.com
2017 © Pedro Peláez
Console commands in PHP
Tool to quickly write console commands in PHP. It is based on a Symfony Console Component., (*1)
Depends: * symfony/console * symfony/finder, (*2)
Create project with Composer:, (*3)
$ composer create-project suncat/console-commands ./cmd
go to the cmd directory with project:, (*4)
$ cd ./cmd
Done!, (*5)
Look at list available commands, (*6)
$ 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:, (*7)
$ app/console generate
Write name of your command class in console dialog:, (*8)
Please enter the name of the command class: AcmeCommand, (*9)
Get the answer:, (*10)
Generated new command class to "./cmd/src/Command/AcmeCommand.php"
Look at list available commands, (*11)
$ 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:, (*12)
$ app/console acme Execute
Now you can change the logic of your command class on your own., (*13)
If the name of your command class will be in CamelCase you get camel:case command., (*14)
Console commands in PHP