]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
baculum: Fixes to support PHP 8
authorMarcin Haba <marcin.haba@bacula.pl>
Fri, 2 Jul 2021 03:54:53 +0000 (05:54 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:03:25 +0000 (09:03 +0100)
gui/baculum/protected/API/Class/BLStat.php
gui/baculum/protected/Common/Class/Params.php
gui/baculum/protected/Common/Class/SessionRecord.php
gui/baculum/protected/Web/Portlets/BaculaConfigDirectives.php

index 482e0f0465c67cd6667b08b21043e8165233cf99..c66d2ab85e69641249ec4c8394bf47622fd608d8 100644 (file)
@@ -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' : '-');
index 4e0e455f21b4a75e3b0a53054dce02b841f4664c..48f8f87ed31223df54afaca796597320de68be06 100644 (file)
@@ -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);
index e3378b3a3120e9f3694d15ea534019621788b957..2dc7457f5ecb6320fa0ac28e5212ebf2451e4a3e 100644 (file)
@@ -187,7 +187,7 @@ class SessionRecord extends CommonModule implements SessionItem {
                return $result;
        }
 
-       public function forceRefresh() {
+       public static function forceRefresh() {
                unset($GLOBALS['sess']);
        }
 
index afdff8f9a9d1c3fd87b3b4b300984bfaeb073d1f..5b26246fdb002ee841fb383f34f089d45d8c7e19 100644 (file)
@@ -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;
                                        }