-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update for PHP 8 #376
update for PHP 8 #376
Conversation
PHP Fatal error: Uncaught TypeError: in_array(): Argument ganglia#2 ($haystack) must be of type array, null given in /usr/share/ganglia/ganglia.php:353
…/usr/share/ganglia/functions.php on line 732
in the test in RHEL8/9. the display is fine, and no errors log in /var/log/www-error.log |
@vvuksan , It is recommended to publish a new release now. |
@@ -1820,7 +1820,7 @@ protected function parseFunction($in, $from, $to, $parsingParams = false, $curBl | |||
if ($func === 'tif') { | |||
$params[] = $tokens; | |||
} | |||
$output = call_user_func_array($funcCompiler, $params); | |||
$output = call_user_func_array($funcCompiler, array_values($params)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: PHP Fatal error: Uncaught Error: Unknown named parameter $* in /usr/share/ganglia/dwoo/Dwoo/Compiler.php:1823
Not sure if this would introduce a logic bug, but the web page looks normal.
@@ -594,7 +594,7 @@ function get_load_heatmap($hosts_up, $host_regex, $metrics, $load_scale, $tpl_da | |||
if (array_key_exists($user_metricname, $metrics)) | |||
$units = $metrics[$user_metricname]['UNITS']; | |||
} else { | |||
if (array_key_exists($user_metricname, $metrics[key($metrics)])) | |||
if ((!is_null($metrics[key($metrics)])) && array_key_exists($user_metricname, $metrics[key($metrics)])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: PHP Fatal error: Uncaught TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in /usr/share/ganglia/cluster_view.php:597
@@ -350,7 +350,7 @@ function Gmetad () { | |||
} | |||
|
|||
if ($debug) print "<br/>DEBUG: Creating parser\n"; | |||
if ( in_array($context, $SKIP_GMETAD_CONTEXTS) ) { | |||
if ( isset($context) && is_array($context) && isset($SKIP_GMETAD_CONTEXTS) && is_array($SKIP_GMETAD_CONTEXTS) && in_array($context, $SKIP_GMETAD_CONTEXTS) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: PHP Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array, null given in /usr/share/ganglia/ganglia.php:353
$count=0; | ||
} else { | ||
$count=count($names); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix: PHP Fatal error: Uncaught TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given in /usr/share/ganglia/meta_view.php:211
I still get a PHP error |
It is not a bug of php versions. It is the same issue inside php5\7\8. You can test php versions in a oline-php-tester, such as testing the follow code in php tester
You are Wellcome to report a new issue. note show how to reproduce it. |
Ah all right. At least that was the last error I noticed when looking through the log files. |
@iGeorgeX Can be fixed by adding |
now woks fine in php8. It is tested in RHEL8 (php7) and RHEL9 (php8). Both works fine !!!