diff --git a/lib/Controller/CapabilitiesController.php b/lib/Controller/CapabilitiesController.php index 35c1adb..62950b2 100644 --- a/lib/Controller/CapabilitiesController.php +++ b/lib/Controller/CapabilitiesController.php @@ -60,6 +60,7 @@ class CapabilitiesController extends Controller { if ($load = Util\Debug::getLoadAvg()) $statistics['load'] = $load; if ($uptime = Util\Debug::getUptime()) $statistics['uptime'] = $uptime*1000; if ($commit = Util\Debug::getCurrentCommit()) $statistics['commit-hash'] = $commit; + if ($version = phpversion()) $statistics['php-version'] = $version; $capabilities['statistics'] = $statistics; } diff --git a/lib/Util/Debug.php b/lib/Util/Debug.php index c86f17a..9507efe 100644 --- a/lib/Util/Debug.php +++ b/lib/Util/Debug.php @@ -153,11 +153,14 @@ class Debug { * @return array average load (1min, 5min, 15min) */ public static function getLoadAvg() { - if (file_exists("/proc/loadavg")) { - $load = file_get_contents("/proc/loadavg"); + if (function_exists('sys_getloadvg')) { + $load = sys_getloadvg(); + } + elseif (file_exists('/proc/loadavg')) { + $load = file_get_contents('/proc/loadavg'); $load = array_slice(explode(' ', $load), 0, 3); } - elseif (function_exists("shell_exec")) { + elseif (function_exists('shell_exec')) { $load = explode(', ', substr(shell_exec('uptime'), -16)); }