Factory for limesurvey plugin objects.
package | Default |
---|
dispatchEvent(): mixed
: void
mixed
dispatchEvent(\LimeSurvey\PluginManager\PluginEvent $event,string|array $target = array()): \LimeSurvey\PluginManager\PluginEvent
string|array
Optional name of plugin to fire the event on
\LimeSurvey\PluginManager\PluginEvent
getAllowedCorePluginList(): array<mixed,string>
That is, all core plugins not in the black list.
array<mixed,string>
getAPI(): \LimeSurvey\PluginManager\LimesurveyApi
getCorePluginList(): array<mixed,string>
array<mixed,string>
getInstalledPlugins(): array
deprecated | unused in 5.3.8 This prevents errors when a plugin was installed but the files were removed from the server. |
---|---|
array
getPluginDescription(string $class,\ExtensionConfig $extensionConfig = null): string
First look in config.xml, then in plugin class.
todo | Localization. |
---|
string
\ExtensionConfig
string
getPluginFolder(\ExtensionConfig $config,string $pluginType)
getPluginInfo(string $pluginClass, $pluginDir = null): array|null
todo | Read config.xml instead. |
---|
string
The classname of the plugin
array|null
getPluginName(string $class,\ExtensionConfig $extensionConfig = null): string
First look in config.xml, then in plugin class.
todo | Localization. |
---|
string
\ExtensionConfig
string
getStore(string $storageClass): mixed
If needed initializes the storage object.
string
mixed
init(): void
If $plugin->save() is used in this method, it can lead to an infinite event loop, since beforeSave tries to get the PluginManager, which executes init() again.
installPlugin(\ExtensionConfig $extensionConfig,string $pluginType): array
\ExtensionConfig
string
'user' or 'core', depending on location of folder.
array
[boolean $result, string $errorMessage]
installUploadedPlugin(string $destdir): array
string
array
[boolean $result, string $errorMessage]
isPluginActive( $sPluginName): boolean
boolean
isWhitelisted(string $pluginName): boolean
string
boolean
loadAllPlugins(): void
loadPlugin(string $pluginName,integer $id = null,boolean $init = true): \LimeSurvey\PluginManager\iPlugin|null
string
integer
Identifier used for identifying a specific plugin instance.
boolean
launch init function (if exist) If ommitted will return the first instantiated plugin with the given name.
\LimeSurvey\PluginManager\iPlugin|null
The plugin or null when missing
loadPlugins()
Possible improvement would be to load them for a specific context. For instance 'survey' for runtime or 'admin' for backend. This needs some thinking before implementing.
loadQuestionObjects( $forceReload = false)
This registers the question object classes with Yii.
readConfigFiles(): void
scanPlugins(boolean $includeInstalledPlugins = false): array
This function is not efficient so should only be used in the admin interface that specifically deals with enabling / disabling plugins.
todo | Factor out |
---|
boolean
If set, also return plugins even if already installed in database.
array
subscribe(\LimeSurvey\PluginManager\iPlugin $plugin,string $event,string $function = null)
string
Name of the event.
string
Optional function of the plugin to be called.
unsubscribe(\LimeSurvey\PluginManager\iPlugin $plugin,string $event)
string
Name of the event. Use '*', to unsubscribe all events for the plugin.
api :mixed
var | The class name of the API class to load, or |
---|
mixed
guidToQuestion :array
var |
---|
array
plugins :array
var |
---|
array
pluginDirs :array
var |
---|
array
stores :array
var |
---|
array
subscriptions :\LimeSurvey\PluginManager\array<string,
var | array> Array with string key to tuple value like 'eventName' => array($plugin, $method) |
---|
\LimeSurvey\PluginManager\array
shutdownObject :\LimeSurvey\PluginManager\PluginManagerShutdownFunction
Used to deal with syntax errors etc in plugins during load.
var |
---|
\LimeSurvey\PluginManager\PluginManagerShutdownFunction