PHP 인터페이스 PicoPluginInterface

For a list of supported events see {@link DummyPlugin}; you can use {@link DummyPlugin} as template for new plugins. For a list of deprecated events see {@link PicoDeprecated}. You SHOULD NOT use deprecated events when implementing this interface. Deprecated events are triggered by the {@link PicoDeprecated} plugin, if plugins which don't implement this interface are loaded. You can take advantage from this behaviour if you want to do something only when old plugins are loaded. Consequently the old events are never triggered when your plugin is implementing this interface and no old plugins are present. If you're developing a new plugin, you MUST implement this interface. If you're the developer of an old plugin, it is STRONGLY RECOMMENDED to use the events introduced in Pico 1.0 when releasing a new version of your plugin. If you want to use any of the new events, you MUST implement this interface and update all other events you use.
저자: Daniel Rudolf
파일 보기 프로젝트 열기: gilbitron/pico

공개 메소드들

메소드 설명
__construct ( Pico $pico ) Constructs a new instance of a Pico plugin
getDependants ( ) : object[] Returns a list of plugins which depend on this plugin
getDependencies ( ) : string[] Returns a list of names of plugins required by this plugin
getPico ( ) : Pico Returns the plugins instance of Pico
handleEvent ( string $eventName, array $params ) : void Handles a event that was triggered by Pico
isEnabled ( ) : boolean Returns true if this plugin is enabled, false otherwise
isStatusChanged ( ) : boolean Returns true if the plugin was ever enabled/disabled manually
setEnabled ( boolean $enabled, boolean $recursive = true, boolean $auto = false ) : void Enables or disables this plugin

메소드 상세

__construct() 공개 메소드

Constructs a new instance of a Pico plugin
public __construct ( Pico $pico )
$pico Pico current instance of Pico

getDependants() 공개 메소드

Returns a list of plugins which depend on this plugin
public getDependants ( ) : object[]
리턴 object[] dependant plugins

getDependencies() 공개 메소드

Returns a list of names of plugins required by this plugin
public getDependencies ( ) : string[]
리턴 string[] required plugins

getPico() 공개 메소드

Returns the plugins instance of Pico
또한 보기: Pico
public getPico ( ) : Pico
리턴 Pico the plugins instance of Pico

handleEvent() 공개 메소드

Handles a event that was triggered by Pico
public handleEvent ( string $eventName, array $params ) : void
$eventName string name of the triggered event
$params array passed parameters
리턴 void

isEnabled() 공개 메소드

Returns true if this plugin is enabled, false otherwise
또한 보기: PicoPluginInterface::setEnabled()
public isEnabled ( ) : boolean
리턴 boolean plugin is enabled (true) or disabled (false)

isStatusChanged() 공개 메소드

Returns true if the plugin was ever enabled/disabled manually
또한 보기: PicoPluginInterface::setEnabled()
public isStatusChanged ( ) : boolean
리턴 boolean plugin is in its default state (true), false otherwise

setEnabled() 공개 메소드

Enables or disables this plugin
또한 보기: PicoPluginInterface::isEnabled()
또한 보기: PicoPluginInterface::isStatusChanged()
public setEnabled ( boolean $enabled, boolean $recursive = true, boolean $auto = false ) : void
$enabled boolean enable (true) or disable (false) this plugin
$recursive boolean when true, enable or disable recursively In other words, if you enable a plugin, all required plugins are enabled, too. When disabling a plugin, all depending plugins are disabled likewise. Recursive operations are only performed as long as a plugin wasn't enabled/disabled manually. This parameter is optional and defaults to true.
$auto boolean enable or disable to fulfill a dependency This parameter is optional and defaults to false.
리턴 void