danzabar / phalcon-cli
Tools that extend the functionality of the Phalcon frameworks CLI
Installs: 34 779
Dependents: 4
Suggesters: 0
Security: 0
Stars: 20
Watchers: 5
Forks: 6
Open Issues: 1
Requires
- symfony/process: 2.7.*@dev
Requires (Dev)
- mockery/mockery: dev-master
- satooshi/php-coveralls: v1.0.0
- squizlabs/php_codesniffer: dev-master
- symfony/config: 2.7.*@dev
- symfony/console: 2.7.*@dev
- symfony/filesystem: 2.7.*@dev
- symfony/stopwatch: 2.7.*@dev
- symfony/yaml: 2.7.*@dev
This package is not auto-updated.
Last update: 2024-11-19 03:59:55 UTC
README
An expansion to the Phalcon Frameworks CLI Classes. This includes things like Questions, Confirmation, Command test class, Input/Output Streams and Application wrapper that allows you to start a CLI with minimal Effort.
Setting up your application
Setting up your CLI app is easy, heres a little example:
#!/usr/bin/env php
<?php
$app = new Danzabar\CLI\Application;
// Add your Tasks
$app->add(new MyTask);
try {
$app->start($argv);
} catch(\Exception $e) {
echo $e->getMessage();
exit(255);
}
Want to use your own DI instance? cool:
#!/usr/bin/env php
<?php
$di = new Phalcon\DI;
$app = new Danzabar\CLI\Application($di);
$app->add(new Task);
$app->start($argv);
See the documentation below for more details, how to create task classes, setup argument and option variables and more...
Documentation
- Installation
- Writing Tasks
- Working with params
- Arguments and Options
- Input Output
- Helpers
- Questions
- Confirmation
- Tables
- Format
- Testing Commands
Look to the source
The source code and tests contain a lot of usage practises and tricks for using this, so if you are unsure, take a look it might point you in the right direction!
Contributing
If you want to contribute, great. Just fork this repo and make a pull request with changes.