Fix PHP8 errors

This commit is contained in:
bergware
2023-11-28 01:19:02 +01:00
parent 7bc581e77a
commit 989bef6130
2 changed files with 10 additions and 13 deletions

View File

@@ -357,7 +357,7 @@ function plugin($method, $plugin_file, &$error) {
if (isset($file->attributes()->Method)) {
if (!in_array($method, explode(" ", $file->attributes()->Method))) continue;
} elseif ($method != 'install') continue;
$name = $file->attributes()->Name;
$name = $file->attributes()->Name ?: '';
// bergware - check Unraid version dependency (if present)
$min = $file->attributes()->Min;
if ($min && version_compare($unraid['version'],$min,'<')) {

View File

@@ -1,11 +1,9 @@
#!/usr/bin/php
<?PHP
function SysDriverslog($m, $type = "NOTICE") {
if ($type == "DEBUG") return NULL;
$m = print_r($m,true);
$m = str_replace("\n", " ", $m);
$m = str_replace('"', "'", $m);
exec("logger -t webGUI -- \"$m\"");
function SysDriverslog($m, $type='NOTICE') {
if ($type == 'DEBUG') return;
$m = str_replace(["\n",'"'],[" ","'"],print_r($m,true));
exec("logger -t sysDrivers -- \"$m\"");
}
$docroot ??= ($_SERVER['DOCUMENT_ROOT'] ?: '/usr/local/emhttp');
@@ -16,13 +14,12 @@ require_once "$docroot/plugins/dynamix.plugin.manager/include/PluginHelpers.php"
// add translations
require_once "$docroot/webGui/include/Translations.php";
$kernel = shell_exec("uname -r");
$kernel = trim($kernel,"\n");
$lsmod = shell_exec("lsmod");
$supportpage = true;
$kernel = trim(shell_exec("uname -r"));
$lsmod = shell_exec("lsmod");
$supportpage = true;
$modtoplgfile = "/tmp/modulestoplg.json";
$sysdrvfile = "/tmp/sysdrivers.json";
$arrModtoPlg = json_decode(file_get_contents("/tmp/modulestoplg.json") ,TRUE);
$sysdrvfile = "/tmp/sysdrivers.json";
$arrModtoPlg = file_exists($modtoplgfile) ? json_decode(file_get_contents($modtoplgfile), true) : '';
file_put_contents("/tmp/sysdrivers.init","1");
SysDriverslog("SysDrivers Build Starting");