From 04d6d5ca99ebfd1cebb8ce06618fb3811fc1a8aa Mon Sep 17 00:00:00 2001 From: Charles Date: Thu, 9 Jan 2020 10:55:03 +0100 Subject: phpmyadmin working --- srcs/phpmyadmin/libraries/classes/SysInfoSunOS.php | 81 ++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 srcs/phpmyadmin/libraries/classes/SysInfoSunOS.php (limited to 'srcs/phpmyadmin/libraries/classes/SysInfoSunOS.php') diff --git a/srcs/phpmyadmin/libraries/classes/SysInfoSunOS.php b/srcs/phpmyadmin/libraries/classes/SysInfoSunOS.php new file mode 100644 index 0000000..6158b62 --- /dev/null +++ b/srcs/phpmyadmin/libraries/classes/SysInfoSunOS.php @@ -0,0 +1,81 @@ +_kstat('unix:0:system_misc:avenrun_1min'); + + return ['loadavg' => $load1]; + } + + /** + * Checks whether class is supported in this environment + * + * @return bool true on success + */ + public function supported() + { + return @is_readable('/proc/meminfo'); + } + + /** + * Gets information about memory usage + * + * @return array with memory usage data + */ + public function memory() + { + $pagesize = (int) $this->_kstat('unix:0:seg_cache:slab_size'); + $mem = []; + $mem['MemTotal'] = (int) $this->_kstat('unix:0:system_pages:pagestotal') * $pagesize; + $mem['MemUsed'] = (int) $this->_kstat('unix:0:system_pages:pageslocked') * $pagesize; + $mem['MemFree'] = (int) $this->_kstat('unix:0:system_pages:pagesfree') * $pagesize; + $mem['SwapTotal'] = (int) $this->_kstat('unix:0:vminfo:swap_avail') / 1024; + $mem['SwapUsed'] = (int) $this->_kstat('unix:0:vminfo:swap_alloc') / 1024; + $mem['SwapFree'] = (int) $this->_kstat('unix:0:vminfo:swap_free') / 1024; + + return $mem; + } +} -- cgit