vhtvn / vht-phalcon-cli
CLI Tools for the Phalcon Framework
v1.0.1
2016-07-18 19:08 UTC
Requires
- danzabar/phalcon-cli: 1.x
This package is not auto-updated.
Last update: 2024-11-03 08:28:33 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:
set_time_limit(0);
require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../app/tasks/BasicTask.php';
use Vht\Cli\Application;
$app = new Application;
// Add your Tasks
$app->add(new BasicTask());
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 Vht\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...
Example
cd vht-phalcon-cli
php app/cli basic
php app/cli basic:other