PHP Class NerdsAndCompany\Schematic\Console\App

Sync Craft Setups.
Author: Nerds & Company
Inheritance: extends CConsoleApplication
Mostra file Open project: itmundi/schematic

Public Properties

Property Type Description
$componentAliases

Public Methods

Method Description
getComponent ( string $id, boolean $createIfNull = true ) : mixed Override getComponent() so we can attach any pending events if the component is getting initialized as well as do some special logic around creating the Craft::app()->db application component.
getLanguage ( ) : string Returns the target application language.
getTimeZone ( ) : string Returns the system time zone. Note that this method cannot be in {@link AppBehavior}, because Yii will check {@link \CApplication::getTimeZone()} instead.
handleError ( integer $code, string $message, string $file, integer $line )
init ( ) Initializes the console app by creating the command runner.
isConsole ( ) : boolean Returns whether we are executing in the context on a console app.
on ( string $event, mixed $handler ) Attaches an event handler, or remembers it for later if the component has not been initialized yet.
setComponents ( $components, boolean $merge = true ) Sets the application components.
setLanguage ( string $language ) Sets the target application language.

Protected Methods

Method Description
createCommandRunner ( ) : ConsoleCommandRunner

Private Methods

Method Description
_attachEventListeners ( string $componentId ) Attaches any pending event listeners to the newly-initialized component.
_installCraft ( ) Install Craft.
_setEditionComponents ( ) Sets the edition components.
_setSchematicComponents ( ) Sets the schematic components.

Method Details

createCommandRunner() protected method

protected createCommandRunner ( ) : ConsoleCommandRunner
return ConsoleCommandRunner

getComponent() public method

Override getComponent() so we can attach any pending events if the component is getting initialized as well as do some special logic around creating the Craft::app()->db application component.
public getComponent ( string $id, boolean $createIfNull = true ) : mixed
$id string
$createIfNull boolean
return mixed

getLanguage() public method

Returns the target application language.
public getLanguage ( ) : string
return string

getTimeZone() public method

Returns the system time zone. Note that this method cannot be in {@link AppBehavior}, because Yii will check {@link \CApplication::getTimeZone()} instead.
public getTimeZone ( ) : string
return string

handleError() public method

public handleError ( integer $code, string $message, string $file, integer $line )
$code integer The level of the error raised
$message string The error message
$file string The filename that the error was raised in
$line integer The line number the error was raised at

init() public method

Initializes the console app by creating the command runner.
public init ( )

isConsole() public method

Returns whether we are executing in the context on a console app.
public isConsole ( ) : boolean
return boolean

on() public method

The event should be identified in a serviceHandle.eventName format. For example, if you want to add an event handler for {@link EntriesService::onSaveEntry()}, you would do this: php Craft::app()->on('entries.saveEntry', function(Event $event) { ... }); Note that the actual event name (saveEntry) does not need to include the “on”. By default, event handlers will not get attached if Craft is current in the middle of updating itself or a plugin. If you want the event to fire even in that condition, pass true to the $evenDuringUpdates argument.
public on ( string $event, mixed $handler )
$event string The event to listen for
$handler mixed The event handler

setComponents() public method

Sets the application components.
public setComponents ( $components, boolean $merge = true )
$components
$merge boolean

setLanguage() public method

Sets the target application language.
public setLanguage ( string $language )
$language string

Property Details

$componentAliases public_oe property

public $componentAliases