Project Versions

Table Of Contents

Previous topic

Class Phalcon\Annotations\Reflection

Next topic

Class Phalcon\CLI\Console\Exception

This Page

Class Phalcon\CLI\Console

implements Phalcon\DI\InjectionAwareInterface, Phalcon\Events\EventsAwareInterface

This component allows to create CLI applications using Phalcon

Methods

public setDI (Phalcon\DiInterface $dependencyInjector)

Sets the DependencyInjector container

public Phalcon\DiInterface getDI ()

Returns the internal dependency injector

public setEventsManager (Phalcon\Events\ManagerInterface $eventsManager)

Sets the events manager

public Phalcon\Events\ManagerInterface getEventsManager ()

Returns the internal event manager

public registerModules (array $modules)

Register an array of modules present in the console

<?php

$application->registerModules(array(
    'frontend' => array(
            'className' => 'Multiple\Frontend\Module',
            'path' => '../apps/frontend/Module.php'
    ),
    'backend' => array(
            'className' => 'Multiple\Backend\Module',
            'path' => '../apps/backend/Module.php'
    )
));

public addModules (array $modules)

Merge modules with the existing ones

<?php

$application->addModules(array(
    'admin' => array(
            'className' => 'Multiple\Admin\Module',
            'path' => '../apps/admin/Module.php'
    )
));

public array getModules ()

Return the modules registered in the console

public mixed handle ([array $arguments])

Handle the whole command-line tasks