LoxBerry::System::plugindata

$plugindata = LoxBerry::System::plugindata([$pluginname/$pluginfolder]);

Diese Funktion liefert einen Hash mit allen Daten des aktuell aufrufenden Plugins aus der Plugindatenbank. Optional kann ein Pluginname oder ein Pluginfolder übergeben werden, um die Daten des angegebenen Plugins zu erhalten.Aus dem Hash können unterschiedliche Einstellungen des Plugins aus der Plugindatenbank abgerufen werden.

Die Labels, die für den Hash verwendet werden können, findest du unten.

Verwendung

use LoxBerry::System;
 
# Getting data from current plugin 
my $plugin = LoxBerry::System::plugindata();
print STDERR "Mein Plugin $plugin->{PLUGINDB_TITLE} hat die Version $plugin->{PLUGINDB_VERSION} und der aktuell eingestellte Loglevel ist $plugin->{PLUGINDB_LOGLEVEL}.";
 
# Getting data from any plugin with pluginname oder pluginfolder
my $plugin = LoxBerry::System::plugindata("squeezelite");

Verfügbare Hash-Labels

This table describes the keys to read from plugin database, and the log level of the LB module functions LoxBerry::System::get_plugins and LoxBerry::System::plugindata (Perl), and LBSystem::get_plugins and LBSystem::plugindata (PHP).The parameters of each plugin can be read with the following keys:

Hash-Variable pro Array-ZeileInhalt DB-Spalte
PLUGINDB_NO Plugin Number  
PLUGINDB_MD5_CHECKSUM The MD5 Hash generated of Author and E-Mail 0
PLUGINDB_AUTHOR_NAME The Plugin author name 1
PLUGINDB_AUTHOR_EMAIL The authors email address 2
PLUGINDB_VERSION The version of the plugin 3
PLUGINDB_NAME The short name of your plugin 4
PLUGINDB_FOLDER The installation folder of your plugin. Usually it is equal to NAME, but on uniqueness problems, it will be different 5
PLUGINDB_TITLE The common title of your plugin 6
PLUGINDB_INTERFACE This is the interface version of the plugin interface (currently 1.0 or 2.0) 7
PLUGINDB_AUTOUPDATE 0 … Plugin does not provide automatic updates

1 … Updates disabled

2 … Notify about Updates

3 … Automatic Updates to release versions

4 … Automatic Updates to prerelease versions
8
PLUGINDB_RELEASECFG URL to the plugin's Release Config file. This file contains the new version and the download url for the ZIP archive for new releases. Used in conjunction with AutoUpdate (see above) 9
PLUGINDB_PRERELEASECFG URL to the plugin's Pre-Release Config file. This file contains the new version and the download url for the ZIP archive for new prereleases. Used in conjunction with AutoUpdate (see above) 10
PLUGINDB_LOGLEVEL Log Level 0-7 (Tabelle siehe unten)

If set to -1, this indicates PLUGINDB_LOGLEVELS_ENABLED = 0
11
PLUGINDB_LOGLEVELS_ENABLED 0 … Plugin does not use the loglevel setting from the user in plugin management

1 … Plugin uses the loglevel setting from plugin management
PLUGINDB_ICONURI This is the calulated http URI of the plugin icon (e.g. for <img>). This is not a local filesystem path, but a webserver path  
PLUGINDB_COMMENT Only set if the line is a comment from plugindb  

Log Levels

The Log Levels are leant on the syslog log levels:

LevelName Shortcut Use when
0 Emergency LOGEMERGE… your LoxBerry burns
1 Alert LOGALERT … if the critical information also needs to be pushed to the user
2 Critical LOGCRIT … when user intervention is needed to continue operation
3 Error → Default valueLOGERR … when an error occurs but
4 Warning LOGWARN … when something is strange but does not stop operation
5 Notice LOGOK … is to inform the user that something went ok
6 Informational LOGINF … additional infos to any status
7 Debug LOGDEB … for heavy debugging that a user normally don't need.

If a user select Level 3 (Error), he get's all messages from severity 0 to severity 3. If the user selects 5, he will get everything from 0 to 5.