Skip to end of metadata
Go to start of metadata

$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-ZeileInhaltDB-Spalte
PLUGINDB_NOPlugin Number 
PLUGINDB_MD5_CHECKSUMThe MD5 Hash generated of Author and E-Mail0
PLUGINDB_AUTHOR_NAMEThe Plugin author name1
PLUGINDB_AUTHOR_EMAILThe authors email address2
PLUGINDB_VERSIONThe version of the plugin3
PLUGINDB_NAMEThe short name of your plugin4
PLUGINDB_FOLDERThe installation folder of your plugin. Usually it is equal to NAME, but on uniqueness problems, it will be different5
PLUGINDB_TITLEThe common title of your plugin6
PLUGINDB_INTERFACEThis 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_RELEASECFGURL 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_PRERELEASECFGURL 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_ICONURIThis 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_COMMENTOnly set if the line is a comment from plugindb 

 

Log Levels

The Log Levels are leant on the syslog log levels:

LevelNameShortcutUse when
0EmergencyLOGEMERGE... your LoxBerry burns
1AlertLOGALERT... if the critical information also needs to be pushed to the user
2CriticalLOGCRIT... when user intervention is needed to continue operation
3Error → Default valueLOGERR... when an error occurs but
4WarningLOGWARN... when something is strange but does not stop operation
5NoticeLOGOK... is to inform the user that something went ok
6InformationalLOGINF... additional infos to any status
7DebugLOGDEB... 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.

  • No labels