====== Module Comparison Perl vs. PHP ====== 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. ^Function ^Description ^ Perl LoxBerry::System ^ PHP loxberry_system.php ^More information ^ |Plugin Global Variables |Global Variables for the path to Plugin directories | AVAILABLE | AVAILABLE |PHP: Globals and Constants | |System Global Variables |Global Variables for the system directories | AVAILABLE | AVAILABLE | | |get_miniservers |Reads the Miniserver list from general.cfg | AVAILABLE | AVAILABLE | | |get_miniserver_by_ip |Get Miniserver number by IP address | AVAILABLE | AVAILABLE | | |get_miniserver_by_name |Get Miniserver number by it's name | AVAILABLE | AVAILABLE | | |get_binaries |Get a hash of all system binaries | AVAILABLE | AVAILABLE | | |pluginversion |Return Plugin version of plugin database | AVAILABLE | AVAILABLE | | |pluginloglevel |Returns the loglevel of the plugin | AVAILABLE | | | |plugindata |Returns plugin data for a specific plugin | AVAILABLE | AVAILABLE | | |get_plugins |Returns an array of all plugins | AVAILABLE | AVAILABLE | | |lbversion |Returns LoxBerry system version | AVAILABLE | AVAILABLE | | |systemloglevel |Returns the LoxBerry system loglevel | AVAILABLE | | | |get_ftpport |Returns the FTP port of Miniserver (incl. Cloud DNS) | AVAILABLE | AVAILABLE | | |get_localip |Returns the current IP address as string | AVAILABLE | AVAILABLE | | |lblanguage |Returns LoxBerrys language from GET, POST or system setting | AVAILABLE | AVAILABLE | | |readlanguage |Collects the translations and returns a hash/array | AVAILABLE | AVAILABLE | | |lbhostname |Returns current LoxBerry hostname | AVAILABLE | AVAILABLE | | |lbfriendlyname |Returns the user set friendlyname | AVAILABLE | AVAILABLE | | |lbwebserverport |Returns the Apache2 port of LoxBerry | AVAILABLE | AVAILABLE | | |is_enabled |Returns 1/True for fuzzy enabled strings | AVAILABLE | AVAILABLE | | |is_disabled |Returns 0/True for fuzzy disabled strings | AVAILABLE | AVAILABLE | | |trim |Trims blanks | AVAILABLE | AVAILABLE |PHP: System function | |ltrim |Trims left blanks | AVAILABLE | AVAILABLE |PHP: System function | |rtrim |Trims right blanks | AVAILABLE | AVAILABLE |PHP: System function | |begins_with |Returns true if one string begins with a other string | AVAILABLE | AVAILABLE |PHP: ''%%if(strpos($str, "http://") === 0)%%''| |currtime |Returns the current time in different formats | AVAILABLE | AVAILABLE | | |check_securepin |Checks the submitted securepin against the database | AVAILABLE | N/A | | |reboot_requred |Sets the reboot required state with optional text. | AVAILABLE | AVAILABLE | | |diskspaceinfo |Returns diskspace infos for a specific path or all volumes | AVAILABLE | N/A | | |lock / unlock |Locks and unlocks a file to prevent multiple execution | AVAILABLE | | | |bytes_humanreadable |Creates a human-readable string from a filesize | AVAILABLE | | | |read_file |Reads a full file in one pass | AVAILABLE | | | |Usable for plugins |Features are supported to be used in Plugins | FULL | FULL | | |Usable for system widgets|System 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. ^Function ^Description ^ Perl LoxBerry::Web ^ PHP loxberry_web.php ^More information ^ |$lbpluginpage, $lbsystempage |Global vars to LoxBerry's index page | AVAILABLE | AVAILABLE |This should be used if your plugin links back to LoxBerry's Plugin overview | |lbheader |Prints the header template including help | AVAILABLE | AVAILABLE | | |lbfooter |Prints the footer template | AVAILABLE | AVAILABLE | | |head |Prints the template
including start tag | AVAILABLE | AVAILABLE | | |pagestart |Prints the jQuery Mobile page start template including help | AVAILABLE | AVAILABLE | | |pageend |Prints the jQuery Mobile page end template | AVAILABLE | AVAILABLE | | |foot |Prints the template foot | AVAILABLE | AVAILABLE | | |get_plugin_icon |Returns the URI of the plugin icon in specified size | AVAILABLE | AVAILABLE | | |iso_languages |Returns 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| |[[entwickler:perl_develop_plugins_with_perl:perl_loxberry_sdk_dokumentation:perlmodul_loxberryweb:navigation_bar_perl|Navigation Bar (Perl)]]|Prints navigation on top of the page | AVAILABLE | AVAILABLE | | |logfile_button_html |Returns the full html code to display a dynamic logfile button | AVAILABLE | | | |loglist_url |Returns the link to a list of logfiles of a plugin | AVAILABLE | | | |loglist_button_html |Returns the full html code to display a button to the logfile list | AVAILABLE | | | |mslist_select_html |Returns html for a Miniserver selection dropdown | AVAILABLE | | | |loglevel_select_html |Returns html for a loglevel selection dropdown | AVAILABLE | | | |loglist_html |Returns html showing a list of logfiles | AVAILABLE | | | |Usable for plugins |Functions can be used in plugins | FULL | FULL | | |Usable for system widgets |System 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. ^Function ^Description ^ Perl LoxBerry::Storage ^ PHP loxberry_storage.php ^More information ^ |get_netshares |Returns an array of all reachable Network Shares | AVAILABLE\\ \\ \\ | N/A |Could be used to create a