From: Marcin Haba Date: Fri, 2 Jul 2021 03:54:53 +0000 (+0200) Subject: baculum: Fixes to support PHP 8 X-Git-Tag: Release-11.3.2~208 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=93adc0a013092b4c4ce12ba3b6bc19c8ecacdaf6;p=thirdparty%2Fbacula.git baculum: Fixes to support PHP 8 --- diff --git a/gui/baculum/protected/API/Class/BLStat.php b/gui/baculum/protected/API/Class/BLStat.php index 482e0f046..c66d2ab85 100644 --- a/gui/baculum/protected/API/Class/BLStat.php +++ b/gui/baculum/protected/API/Class/BLStat.php @@ -136,7 +136,7 @@ class BLStat extends APIModule { $p = $dmode; $t = decoct($dmode & 0170000); // File Encoding Bit - $mode = (key_exists(octdec($t), $ts)) ? $ts[octdec($t)]{0} : 'u'; + $mode = (key_exists(octdec($t), $ts)) ? $ts[octdec($t)][0] : 'u'; $mode .= (($p & 0x0100) ? 'r' : '-') . (($p & 0x0080) ? 'w' : '-'); $mode .= (($p & 0x0040) ? (($p & 0x0800) ?'s':'x'):(($p & 0x0800) ? 'S' : '-')); $mode .= (($p & 0x0020) ? 'r':'-').(($p & 0x0010)? 'w' : '-'); diff --git a/gui/baculum/protected/Common/Class/Params.php b/gui/baculum/protected/Common/Class/Params.php index 4e0e455f2..48f8f87ed 100644 --- a/gui/baculum/protected/Common/Class/Params.php +++ b/gui/baculum/protected/Common/Class/Params.php @@ -66,7 +66,7 @@ class Params extends CommonModule { 'sat' => 'Saturday' ); - public function getMonthsConfig(array $months_cfg) { + public static function getMonthsConfig(array $months_cfg) { $month = ''; $month_count = count($months_cfg); $months = array_keys(Params::$months); @@ -82,7 +82,7 @@ class Params extends CommonModule { return $month; } - public function getWeeksConfig(array $weeks_cfg) { + public static function getWeeksConfig(array $weeks_cfg) { $week = ''; $week_count = count($weeks_cfg); $weeks = array_keys(Params::$weeks); @@ -98,7 +98,7 @@ class Params extends CommonModule { return $week; } - public function getWdaysConfig(array $wdays_cfg) { + public static function getWdaysConfig(array $wdays_cfg) { $wday = ''; $wday_count = count($wdays_cfg); $wdays = array_keys(Params::$wdays); @@ -120,7 +120,7 @@ class Params extends CommonModule { * @param array $days_cfg days array (ex. array(0,1,2,3,4)) * @return string days config value */ - public function getDaysConfig(array $days_cfg) { + public static function getDaysConfig(array $days_cfg) { $days = ''; if (count($days_cfg) < 31) { $days_map = array_map(array('Params', 'getDayByNo') , $days_cfg); diff --git a/gui/baculum/protected/Common/Class/SessionRecord.php b/gui/baculum/protected/Common/Class/SessionRecord.php index e3378b3a3..2dc7457f5 100644 --- a/gui/baculum/protected/Common/Class/SessionRecord.php +++ b/gui/baculum/protected/Common/Class/SessionRecord.php @@ -187,7 +187,7 @@ class SessionRecord extends CommonModule implements SessionItem { return $result; } - public function forceRefresh() { + public static function forceRefresh() { unset($GLOBALS['sess']); } diff --git a/gui/baculum/protected/Web/Portlets/BaculaConfigDirectives.php b/gui/baculum/protected/Web/Portlets/BaculaConfigDirectives.php index afdff8f9a..5b26246fd 100644 --- a/gui/baculum/protected/Web/Portlets/BaculaConfigDirectives.php +++ b/gui/baculum/protected/Web/Portlets/BaculaConfigDirectives.php @@ -122,7 +122,7 @@ class BaculaConfigDirectives extends DirectiveListTemplate { $resource_type = $this->getResourceType(); $resource_name = $this->getResourceName(); $directives = array(); - $parent_directives = array(); + $parent_directives = new StdClass; $config = new stdClass; $predefined = false; if ($load_values === true) { @@ -172,7 +172,7 @@ class BaculaConfigDirectives extends DirectiveListTemplate { if (is_object($directive_desc)) { if (property_exists($directive_desc, 'Required')) { $required = $directive_desc->Required; - if ($load_values === true && key_exists($directive_name, $parent_directives)) { + if ($load_values === true && property_exists($parent_directives, $directive_name)) { // values can be taken from JobDefs $required = false; }