PHP Class NerdsAndCompany\Schematic\Console\App

Sync Craft Setups.
Author: Nerds & Company
Inheritance: extends CConsoleApplication
Afficher le fichier Open project: itmundi/schematic

Méthodes publiques

Свойство Type Description
$componentAliases

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode Description
createCommandRunner ( ) : ConsoleCommandRunner

Private Methods

Méthode 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 méthode

protected createCommandRunner ( ) : ConsoleCommandRunner
Résultat ConsoleCommandRunner

getComponent() public méthode

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
Résultat mixed

getLanguage() public méthode

Returns the target application language.
public getLanguage ( ) : string
Résultat string

getTimeZone() public méthode

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
Résultat string

handleError() public méthode

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 méthode

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

isConsole() public méthode

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

on() public méthode

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 méthode

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

setLanguage() public méthode

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

Property Details

$componentAliases public_oe property

public $componentAliases