Skip to end of metadata
Go to start of metadata

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

 This function returns a named array with all data of the current plugin from the plugin database. Optionally you can use the pluginname or foldername as parameter, to get the data from the named plugin.From the array you can access different settings that are stored in LoxBerry's plugin database.

The labels of the named array are listed below.


require_once "loxberry_system.php";

// Getting data from current plugin 
$plugin = LBSystem::plugindata();
echo "My plugin {$plugin['PLUGINDB_TITLE']} uses version {$plugin['PLUGINDB_VERSION']} and the current loglevel set by the user is {$plugin['PLUGINDB_LOGLEVEL']}.";

// Getting data from any plugin with pluginname oder pluginfolder
$plugin = LBSystem::plugindata("squeezelite");

Available array 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

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

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

Log Level 0-7 (Tabelle siehe unten)

If set to -1, this indicates PLUGINDB_LOGLEVELS_ENABLED = 0


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