Total Complexity | 5 |
Total Lines | 67 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
15 | class SunOs extends Base |
||
16 | { |
||
17 | /** |
||
18 | * The OS name |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | public $os = 'SunOS'; |
||
23 | |||
24 | /** |
||
25 | * Read value from kstat |
||
26 | * |
||
27 | * @param string $key Key to read |
||
28 | * |
||
29 | * @return string with value |
||
30 | */ |
||
31 | private function kstat($key) |
||
32 | { |
||
33 | /** @psalm-suppress ForbiddenCode */ |
||
34 | $m = shell_exec('kstat -p d ' . $key); |
||
35 | |||
36 | if ($m) { |
||
37 | [, $value] = explode("\t", trim($m), 2); |
||
38 | |||
39 | return $value; |
||
40 | } |
||
41 | |||
42 | return ''; |
||
43 | } |
||
44 | |||
45 | /** |
||
46 | * Gets load information |
||
47 | * |
||
48 | * @return array with load data |
||
49 | */ |
||
50 | public function loadavg() |
||
55 | } |
||
56 | |||
57 | /** |
||
58 | * Checks whether class is supported in this environment |
||
59 | */ |
||
60 | public static function isSupported(): bool |
||
61 | { |
||
62 | return @is_readable('/proc/meminfo'); |
||
63 | } |
||
64 | |||
65 | /** |
||
66 | * Gets information about memory usage |
||
67 | * |
||
68 | * @return array with memory usage data |
||
69 | */ |
||
70 | public function memory() |
||
82 | } |
||
83 | } |
||
84 |