diff --git a/lib/SystemStatistics.php b/lib/SystemStatistics.php index fd9086ed..e48be7cd 100644 --- a/lib/SystemStatistics.php +++ b/lib/SystemStatistics.php @@ -67,6 +67,11 @@ public function getSystemStatistics(bool $skipApps = false, bool $skipUpdate = t 'swap_free' => $this->toKibibytes($memory->getSwapFree()), ]; + $aioVersion = $this->getAioVersion(); + if ($aioVersion !== null) { + $data['aio_version'] = $aioVersion; + } + if (!$skipApps) { $data['apps'] = $this->getAppsInfo(); } @@ -78,6 +83,18 @@ public function getSystemStatistics(bool $skipApps = false, bool $skipUpdate = t return $data; } + /** + * Get the Nextcloud AIO version, which AIO stores as AIO_VERSION in + * config.php (e.g. "v12.6.1"). + * + * @return string|null the version without the "v" prefix, or null when not running in AIO + */ + protected function getAioVersion(): ?string { + $aioVersion = $this->config->getSystemValueString('AIO_VERSION', ''); + $aioVersion = ltrim(trim($aioVersion), 'v'); + return $aioVersion !== '' ? $aioVersion : null; + } + /** * Get info about server updates and last checked timestamp *