Cli\Task

extends abstract class Phalcon\Di\Injectable implements Phalcon\Events\EventsAwareInterface, Phalcon\Di\InjectionAwareInterface, Phalcon\Cli\TaskInterface Source on GitHub Every command-line task should extend this class that encapsulates all the task functionality A task can be used to run “tasks” such as migrations, cronjobs, unit-tests, or anything that you want. The Task class should at least have a “mainAction” method class HelloTask extends \Phalcon\Cli\Task { // This action will be ex

Command Line Applications

CLI applications are executed from the command line. They are useful to create cron jobs, scripts, command utilities and more. Structure A minimal structure of a CLI application will look like this: app/config/config.php app/tasks/MainTask.php app/cli.php <– main bootstrap file Creating a Bootstrap As in regular MVC applications, a bootstrap file is used to bootstrap the application. Instead of the index.php bootstrapper in web applications, we use a cli.php file for bootstrapping the appl

Config::get

public get (mixed $index, [mixed $defaultValue]) Gets an attribute from the configuration, if the attribute isn’t defined returns null If the value is exactly null or is not defined the default value will be used instead echo $config->get('controllersDir', '../app/controllers/');

Config::merge

public merge (Phalcon\Config $config) Merges a configuration into the current one $appConfig = new \Phalcon\Config(array('database' => array('host' => 'localhost'))); $globalConfig->merge($config2);

Config::offsetExists

public offsetExists (mixed $index) Allows to check whether an attribute is defined using the array-syntax var_dump(isset($config['database']));

Cli\TaskInterface

Source on GitHub

Config::count

public count () Returns the count of properties set in the config print count($config); or print $config->count();

Config

implements ArrayAccess, Countable Source on GitHub Phalcon\Config is designed to simplify the access to, and the use of, configuration data within applications. It provides a nested object property based user interface for accessing this configuration data within application code. $config = new \Phalcon\Config(array( "database" => array( "adapter" => "Mysql", "host" => "localhost", "username" => "scott", "password" => "cheetah",

Cli\Router\RouteInterface::reConfigure

abstract public reConfigure (mixed $pattern, [mixed $paths]) ...

Cli\Router\RouteInterface::setName

abstract public setName (mixed $name) ...