Skip to content

Commit 9972172

Browse files
committed
Changes for typesafe and PHP 8.4
1 parent b7e2c5c commit 9972172

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

php/plugins/processes.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,19 @@
44
// plugins/processes.php 20170225 - 20260128
55
// Copyright (C) 2015-2025 Mark Constable <markc@renta.net> (AGPL-3.0)
66

7-
class Plugins_Processes extends Plugin
7+
final class Plugins_Processes extends Plugin
88
{
99
public function list(): string
1010
{
1111
elog(__METHOD__);
1212

1313
$cmd = "ps -eo rss:10,vsz:10,%cpu:5,cmd --sort=rss | grep -v \"^\s\+0\" | cut -c -79";
14-
return $this->t->list(['procs' => shell_exec($cmd)]);
14+
$output = shell_exec($cmd);
15+
16+
if ($output === null || $output === false) {
17+
return $this->t->list(['procs' => 'Error: Unable to fetch process information']);
18+
}
19+
20+
return $this->t->list(['procs' => $output]);
1521
}
1622
}

0 commit comments

Comments
 (0)