Remove PHP8 blockers in LibreNMS (#12451)

* PHP8 support
looks like one upstream package needs to be updated also.

* Sync dependencies with laravel/laravel

* remove php 8 tests for now

Co-authored-by: Jellyfrog <Jellyfrog@users.noreply.github.com>
This commit is contained in:
Tony Murray
2021-01-28 11:11:55 -06:00
committed by GitHub
parent f230fc8342
commit 39217d003f
4 changed files with 674 additions and 87 deletions
+8 -8
View File
@@ -21,7 +21,7 @@
"irc": "irc://irc.freenode.org/#librenms"
},
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"ext-curl": "*",
"ext-gd": "*",
"ext-json": "*",
@@ -38,12 +38,12 @@
"easybook/geshi": "^1.0.8",
"ezyang/htmlpurifier": "^4.8",
"fico7489/laravel-pivot": "^3.0",
"fideloper/proxy": "^4.2",
"fideloper/proxy": "^4.4",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"influxdb/influxdb-php": "^1.14",
"laravel/framework": "^8.10",
"laravel/tinker": "^2.0",
"laravel/framework": "^8.12",
"laravel/tinker": "^2.5",
"laravel/ui": "^3.0",
"librenms/laravel-vue-i18n-generator": "^0.1.46",
"nunomaduro/laravel-console-summary": "^1.7",
@@ -62,15 +62,15 @@
"require-dev": {
"barryvdh/laravel-debugbar": "^3.5",
"barryvdh/laravel-ide-helper": "^2.8",
"facade/ignition": "^2.3.6",
"facade/ignition": "^2.5",
"friendsofphp/php-cs-fixer": "^2.16",
"fzaninotto/faker": "^1.9.1",
"fakerphp/faker": "^1.9.1",
"justinrainbow/json-schema": "^5.2",
"laravel/dusk": "^6.7",
"mockery/mockery": "^1.3.1",
"mockery/mockery": "^1.4.2",
"nunomaduro/collision": "^5.0",
"php-parallel-lint/php-parallel-lint": "^1.1",
"phpunit/phpunit": "^9.3",
"phpunit/phpunit": "^9.3.3",
"staudenmeir/dusk-updater": "^1.1"
},
"suggest": {
Generated
+648 -61
View File
File diff suppressed because it is too large Load Diff
+13 -13
View File
@@ -1682,7 +1682,7 @@ function meta_graph_files_count($host, $plugin, $plugin_instance, $type, $type_i
];
$type_instances = ['incoming', 'active', 'deferred'];
while ([$k, $inst] = each($type_instances)) {
foreach ($type_instances as $k => $inst) {
$file = '';
foreach (Config::get('datadirs') as $datadir) {
if (is_file($datadir . '/' . $title . '-' . $inst . '.rrd')) {
@@ -1717,7 +1717,7 @@ function meta_graph_files_size($host, $plugin, $plugin_instance, $type, $type_in
];
$type_instances = ['incoming', 'active', 'deferred'];
while ([$k, $inst] = each($type_instances)) {
foreach ($type_instances as $k => $inst) {
$file = '';
foreach (Config::get('datadirs') as $datadir) {
if (is_file($datadir . '/' . $title . '-' . $inst . '.rrd')) {
@@ -1757,7 +1757,7 @@ function meta_graph_cpu($host, $plugin, $plugin_instance, $type, $type_instances
];
$type_instances = ['idle', 'wait', 'nice', 'user', 'system', 'softirq', 'interrupt', 'steal'];
while ([$k, $inst] = each($type_instances)) {
foreach ($type_instances as $k => $inst) {
$file = '';
foreach (Config::get('datadirs') as $datadir) {
if (is_file($datadir . '/' . $title . '-' . $inst . '.rrd')) {
@@ -1795,7 +1795,7 @@ function meta_graph_memory($host, $plugin, $plugin_instance, $type, $type_instan
];
$type_instances = ['free', 'cached', 'buffered', 'used'];
while ([$k, $inst] = each($type_instances)) {
foreach ($type_instances as $k => $inst) {
$file = '';
foreach (Config::get('datadirs') as $datadir) {
if (is_file($datadir . '/' . $title . '-' . $inst . '.rrd')) {
@@ -1832,7 +1832,7 @@ function meta_graph_vs_threads($host, $plugin, $plugin_instance, $type, $type_in
];
$type_instances = ['total', 'running', 'onhold', 'uninterruptable'];
while ([$k, $inst] = each($type_instances)) {
foreach ($type_instances as $k => $inst) {
$file = '';
foreach (Config::get('datadirs') as $datadir) {
if (is_file($datadir . '/' . $title . '-' . $inst . '.rrd')) {
@@ -1869,7 +1869,7 @@ function meta_graph_vs_memory($host, $plugin, $plugin_instance, $type, $type_ins
];
$type_instances = ['anon', 'rss', 'vml', 'vm'];
while ([$k, $inst] = each($type_instances)) {
foreach ($type_instances as $k => $inst) {
$file = '';
foreach (Config::get('datadirs') as $datadir) {
if (is_file($datadir . '/' . $title . '-' . $inst . '.rrd')) {
@@ -1898,7 +1898,7 @@ function meta_graph_if_rx_errors($host, $plugin, $plugin_instance, $type, $type_
$opts['number_format'] = '%5.2lf';
$opts['rrd_opts'] = ['-v', 'Errors/s'];
while ([$k, $inst] = each($type_instances)) {
foreach ($type_instances as $k => $inst) {
$file = '';
foreach (Config::get('datadirs') as $datadir) {
if (is_file($datadir . '/' . $title . '-' . $inst . '.rrd')) {
@@ -1927,7 +1927,7 @@ function meta_graph_mysql_commands($host, $plugin, $plugin_instance, $type, $typ
$opts['rrd_opts'] = ['COMMENT:Issues/s Cur Ave Min Max\l'];
$opts['number_format'] = '%5.2lf';
while ([$k, $inst] = each($type_instances)) {
foreach ($type_instances as $k => $inst) {
$file = '';
foreach (Config::get('datadirs') as $datadir) {
if (is_file($datadir . '/' . $title . '-' . $inst . '.rrd')) {
@@ -1956,7 +1956,7 @@ function meta_graph_nfs_procedure($host, $plugin, $plugin_instance, $type, $type
$opts['number_format'] = '%5.1lf%s';
$opts['rrd_opts'] = ['-v', 'Ops/s'];
while ([$k, $inst] = each($type_instances)) {
foreach ($type_instances as $k => $inst) {
$file = '';
foreach (Config::get('datadirs') as $datadir) {
if (is_file($datadir . '/' . $title . '-' . $inst . '.rrd')) {
@@ -1994,7 +1994,7 @@ function meta_graph_ps_state($host, $plugin, $plugin_instance, $type, $type_inst
];
$type_instances = ['paging', 'blocked', 'zombies', 'stopped', 'running', 'sleeping'];
while ([$k, $inst] = each($type_instances)) {
foreach ($type_instances as $k => $inst) {
$file = '';
foreach (Config::get('datadirs') as $datadir) {
if (is_file($datadir . '/' . $title . '-' . $inst . '.rrd')) {
@@ -2030,7 +2030,7 @@ function meta_graph_swap($host, $plugin, $plugin_instance, $type, $type_instance
];
$type_instances = ['free', 'cached', 'used'];
while ([$k, $inst] = each($type_instances)) {
foreach ($type_instances as $k => $inst) {
$file = '';
foreach (Config::get('datadirs') as $datadir) {
if (is_file($datadir . '/' . $title . '-' . $inst . '.rrd')) {
@@ -2074,7 +2074,7 @@ function meta_graph_apache_scoreboard($host, $plugin, $plugin_instance, $type, $
];
$type_instances = [/* 'open',*/ 'waiting', 'starting', 'reading', 'sending', 'keepalive', 'dnslookup', 'logging', 'closing', 'finishing', 'idle_cleanup'];
while ([$k, $inst] = each($type_instances)) {
foreach ($type_instances as $k => $inst) {
$file = '';
foreach (Config::get('datadirs') as $datadir) {
if (is_file($datadir . '/' . $title . '-' . $inst . '.rrd')) {
@@ -2119,7 +2119,7 @@ function meta_graph_tcp_connections($host, $plugin, $plugin_instance, $type, $ty
];
$type_instances = ['ESTABLISHED', 'SYN_SENT', 'SYN_RECV', 'FIN_WAIT1', 'FIN_WAIT2', 'TIME_WAIT', 'CLOSE', 'CLOSE_WAIT', 'LAST_ACK', 'CLOSING', 'LISTEN'];
while ([$k, $inst] = each($type_instances)) {
foreach ($type_instances as $k => $inst) {
$file = '';
foreach (Config::get('datadirs') as $datadir) {
if (is_file($datadir . '/' . $title . '-' . $inst . '.rrd')) {
+5 -5
View File
@@ -40,7 +40,7 @@ function read_var($name, &$array, $default = null)
if (is_array($array[$name])) {
if (get_magic_quotes_gpc()) {
$ret = [];
while ([$k, $v] = each($array[$name])) {
foreach ($array[$name] as $k => $v) {
$ret[stripslashes($k)] = stripslashes($v);
}
@@ -499,7 +499,7 @@ function collectd_draw_rrd($host, $plugin, $type, $pinst = null, $tinst = null,
$has_min = false;
reset($rrdinfo['RRA']);
$l_max = 0;
while ([$k, $v] = each($rrdinfo['RRA'])) {
foreach ($rrdinfo['RRA'] as $k => $v) {
if ($v['cf'] == 'MAX') {
$has_max = true;
} elseif ($v['cf'] == 'AVERAGE') {
@@ -527,7 +527,7 @@ function collectd_draw_rrd($host, $plugin, $type, $pinst = null, $tinst = null,
}
reset($rrdinfo['DS']);
while ([$k, $v] = each($rrdinfo['DS'])) {
foreach ($rrdinfo['DS'] as $k => $v) {
if (strlen($k) > $l_max) {
$l_max = strlen($k);
}
@@ -548,7 +548,7 @@ function collectd_draw_rrd($host, $plugin, $type, $pinst = null, $tinst = null,
if ($has_min && $has_max || $has_min && $has_avg || $has_avg && $has_max) {
$n = 1;
reset($rrdinfo['DS']);
while ([$k, $v] = each($rrdinfo['DS'])) {
foreach ($rrdinfo['DS'] as $k => $v) {
$graph[] = sprintf('LINE:%s_%s', $k, $has_min ? 'min' : 'avg');
$graph[] = sprintf('CDEF:%s_var=%s_%s,%s_%s,-', $k, $k, $has_max ? 'max' : 'avg', $k, $has_min ? 'min' : 'avg');
$graph[] = sprintf('AREA:%s_var#%s::STACK', $k, rrd_get_color($n++, false));
@@ -557,7 +557,7 @@ function collectd_draw_rrd($host, $plugin, $type, $pinst = null, $tinst = null,
reset($rrdinfo['DS']);
$n = 1;
while ([$k, $v] = each($rrdinfo['DS'])) {
foreach ($rrdinfo['DS'] as $k => $v) {
$graph[] = sprintf('LINE1:%s_avg#%s:%s ', $k, rrd_get_color($n++, true), $k . substr(' ', 0, ($l_max - strlen($k))));
if (isset($opts['tinylegend']) && $opts['tinylegend']) {
continue;