Skip to end of metadata
Go to start of metadata

This article shows the differences of functionality of LoxBerry's Perl modules and LoxBerry's PHP modules. It is mainly meant as a quick reference for module developers.

The functions and variables are developed as similar as possible, but differences of the call syntax is unavoidable. Because the PHP modules are new, Perl legacy code was avoided in the PHP code. 

LoxBerry::System vs. loxberry_system.php

Provides basic functions to query and set information from users settings at LoxBerry, e.g. the plugins and the Miniservers.

FunctionDescriptionPerl LoxBerry::SystemPHP loxberry_system.phpMore information
Plugin Global VariablesGlobal Variables for the path to Plugin directories

AVAILABLE

AVAILABLE

PHP: Globals and Constants
System Global VariablesGlobal Variables for the system directories

AVAILABLE

AVAILABLE


get_miniserversReads the Miniserver list from general.cfg

AVAILABLE

AVAILABLE


get_miniserver_by_ipGet Miniserver number by IP address

AVAILABLE

AVAILABLE


get_miniserver_by_nameGet Miniserver number by it's name

AVAILABLE

AVAILABLE


get_binariesGet a hash of all system binaries

AVAILABLE

AVAILABLE


pluginversionReturn Plugin version of plugin database

AVAILABLE

AVAILABLE


pluginloglevelReturns the loglevel of the plugin

AVAILABLE



plugindataReturns plugin data for a specific plugin

AVAILABLE

AVAILABLE


get_pluginsReturns an array of all plugins

AVAILABLE

AVAILABLE


lbversionReturns LoxBerry system version

AVAILABLE

AVAILABLE


systemloglevelReturns the LoxBerry system loglevel

AVAILABLE



get_ftpportReturns the FTP port of Miniserver (incl. Cloud DNS)

AVAILABLE

AVAILABLE


get_localipReturns the current IP address as string

AVAILABLE

AVAILABLE


lblanguageReturns LoxBerrys language from GET, POST or system setting

AVAILABLE

AVAILABLE


readlanguageCollects the translations and returns a hash/array

AVAILABLE

AVAILABLE


lbhostnameReturns current LoxBerry hostname

AVAILABLE

AVAILABLE


lbfriendlynameReturns the user set friendlyname

AVAILABLE

AVAILABLE


lbwebserverportReturns the Apache2 port of LoxBerry

AVAILABLE

AVAILABLE


is_enabledReturns 1/True for fuzzy enabled strings

AVAILABLE

AVAILABLE


is_disabledReturns 0/True for fuzzy disabled strings

AVAILABLE

AVAILABLE


trimTrims blanks

AVAILABLE

AVAILABLE

PHP: System function
ltrimTrims left blanks

AVAILABLE

AVAILABLE

PHP: System function
rtrimTrims right blanks

AVAILABLE

AVAILABLE

PHP: System function
begins_withReturns true if one string begins with a other string

AVAILABLE

AVAILABLE

PHP: if(strpos($str, "http://") === 0)
currtimeReturns the current time in different formats

AVAILABLE

AVAILABLE


check_securepinChecks the submitted securepin against the database

AVAILABLE

N/A


reboot_requredSets the reboot required state with optional text.

AVAILABLE

AVAILABLE


diskspaceinfoReturns diskspace infos for a specific path or all volumes

AVAILABLE

N/A


lock / unlockLocks and unlocks a file to prevent multiple execution

AVAILABLE



bytes_humanreadableCreates a human-readable string from a filesize

AVAILABLE



read_fileReads a full file in one pass

AVAILABLE



Usable for pluginsFeatures are supported to be used in Plugins

FULL

FULL


Usable for system widgetsSystem widgets are LoxBerrys own configuration "plugins", shown on the Settings page.

FULL

FULL



LoxBerry::Web vs. loxberry_web.php

Functions to generate the user interface, and add pre-rendered html code to simplify ui generation.

FunctionDescriptionPerl LoxBerry::WebPHP loxberry_web.phpMore information
$lbpluginpage, $lbsystempageGlobal vars to LoxBerry's index page

AVAILABLE

AVAILABLE

This should be used if your plugin links back to LoxBerry's Plugin overview
lbheaderPrints the header template including help

AVAILABLE

AVAILABLE


lbfooterPrints the footer template

AVAILABLE

AVAILABLE


headPrints the template <head> including <body> start tag

AVAILABLE

AVAILABLE


pagestartPrints the jQuery Mobile page start template including help

AVAILABLE

AVAILABLE


pageendPrints the jQuery Mobile page end template

AVAILABLE

AVAILABLE


footPrints the template foot

AVAILABLE

AVAILABLE


get_plugin_iconReturns the URI of the plugin icon in specified size

AVAILABLE

AVAILABLE


iso_languagesReturns all or only translated ISO 639-1 languages

AVAILABLE

N/A

PHP: As this feature is primary for LoxBerry-Core, no PHP feature is planned
Navigation Bar (Perl)Prints navigation on top of the page

AVAILABLE

AVAILABLE


logfile_button_htmlReturns the full html code to display a dynamic logfile button

AVAILABLE



loglist_urlReturns the link to a list of logfiles of a plugin

AVAILABLE



loglist_button_htmlReturns the full html code to display a button to the logfile list

AVAILABLE



mslist_select_htmlReturns html for a Miniserver selection dropdown

AVAILABLE



loglevel_select_htmlReturns html for a loglevel selection dropdown

AVAILABLE



loglist_htmlReturns html showing a list of logfiles

AVAILABLE



Usable for pluginsFunctions can be used in plugins

FULL

FULL


Usable for system widgetsSystem widgets are LoxBerrys own configuration "plugins", shown on the Settings page.

FULL

LIMITED

System help files currently not supported (untested).

  

LoxBerry::Storage vs. loxberry_storage.php

Functions for storage devices like usb and network shares.

FunctionDescriptionPerl LoxBerry::StoragePHP loxberry_storage.phpMore information
get_netsharesReturns an array of all reachable Network SharesAVAILABLE


N/A

Could be used to create a <select>-list with available network shares.
get_netserversReturns an array of all reachable Network Servers (which offers shares)AVAILABLE


N/A


Core-function
get_usbstoragesReturns an array of all conneted USB Storage devicesAVAILABLE


N/A


 Could be used to create a <select>-list with available usb storage devices.
get_storageReturns an array of all storage devices (combined USB and Shares)

AVAILABLE



get_storage_htmlReturns a ready html+js for a storage selection dropdown (e.g. to provide users to select a location)

AVAILABLE



LoxBerry::Log vs. loxberry_log.php

Library to create and show logfiles, and handles notifications. 

FunctionDescriptionPerl LoxBerry::LogPHP loxberry_log.phpMore information
Logging class (methods to a log object)
newConstructor for a new logging session

AVAILABLE



LOGSTART / LOGENDStarting and finishing the logging session

AVAILABLE



loglevelQueries and sets the loglevel

AVAILABLE



autoraiseOn a LOGCRIT log entry, auto-raises the loglevel to 6

AVAILABLE



filehandleLEGACY for LB <1.2.5 

DEPRECATED



filenameReturns the current filename

AVAILABLE



dbkeyReturns the current database key

AVAILABLE



addtimeAdds the current time to every logline

AVAILABLE



logtitleChanges the title of the log during logging

AVAILABLE



defaultOn multiple opened logs, set one log to the default logfile

AVAILABLE



Logfile handling functions
get_logsReturns an array with all logs, with filters by parameter

AVAILABLE



Notification functions
notifyCreates an info or error notification

AVAILABLE



notify_extCreates a notification with extended parameters

AVAILABLE



get_notificationsReturns an array with all notifications, selected by parameters

AVAILABLE



get_notification_countReturns the number of notifications, selected by parameters

AVAILABLE



delete_notificationsDeletes all notifications, selected by parameters

AVAILABLE



delete_notification_keyDeletes a specific notification by key

AVAILABLE



get_notifications_htmlReturns ready html+js for a list of notifications

AVAILABLE



LoxBerry::IO vs. loxberry_io.php

Functions to easily communicate to the Miniserver

FunctionDescriptionPerl LoxBerry::IOPHP loxberry_io.phpMore information
mshttp_sendSends values to Miniserver's HTTP REST API

AVAILABLE



mshttp_send_memSends values to Miniserver's HTTP REST API, using caching

AVAILABLE



mshttp_getReads values from Miniservers HTTP REST API

AVAILABLE



mshttp_callRaw function to send or read data via HTTP REST API

AVAILABLE



msudp_sendSends values via UDP to the Miniserver

AVAILABLE



msudp_send_memSends values via UDP to the Miniserver, using caching

AVAILABLE



LoxBerry::JSON (PHP not available)

Class to simplify working with json (config) files

FunctionDescriptionPerl LoxBerry::JSONPHP not availableMore information
newConstructor for a json object

AVAILABLE



parseParse an already available json string

AVAILABLE



openOpens and parses a json file

AVAILABLE



writeSaves a changed file to disk, using change detection

AVAILABLE



filenameQueries the current filename, or sets a new filename

AVAILABLE



findFind a string in an object in the json (array or named list)

AVAILABLE



dumpDumps the content of the json to stderr

AVAILABLE



  • No labels