PHP Класс NerdsAndCompany\Schematic\Console\App

Sync Craft Setups.
Автор: Nerds & Company
Наследование: extends CConsoleApplication
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$componentAliases

Открытые методы

Метод Описание
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.

Защищенные методы

Метод Описание
createCommandRunner ( ) : ConsoleCommandRunner

Приватные методы

Метод Описание
_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.

Описание методов

createCommandRunner() защищенный Метод

protected createCommandRunner ( ) : ConsoleCommandRunner
Результат ConsoleCommandRunner

getComponent() публичный Метод

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
Результат mixed

getLanguage() публичный Метод

Returns the target application language.
public getLanguage ( ) : string
Результат string

getTimeZone() публичный Метод

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
Результат string

handleError() публичный Метод

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() публичный Метод

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

isConsole() публичный Метод

Returns whether we are executing in the context on a console app.
public isConsole ( ) : boolean
Результат boolean

on() публичный Метод

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() публичный Метод

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

setLanguage() публичный Метод

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

Описание свойств

$componentAliases публичное свойство

public $componentAliases