Tabla de Contenidos

Tema anterior

< Annotations Parser

Próximo tema

Database Abstraction Layer >

Esta página

Command Line Applications

CLI applications are executed from the command line. They are useful to create cron jobs, scripts, command utilities and more.


Tasks are similar to controllers, on them can be implemented


class MonitoringTask extends \Phalcon\CLI\Task

    public function mainAction()



//Using the CLI factory default services container
$di = new Phalcon\DI\FactoryDefault\CLI();

//Create a console application
$console = new \Phalcon\CLI\Console();

$console->handle(array('shell_script_name', 'echo'));