} */ public function collect(): array { return [ 'app_version' => Version::VERSION, 'current_sha' => $this->version->current(), 'os' => VendorHttp::operatingSystem(), 'metadata' => array_filter([ 'php' => PHP_VERSION, 'datenbank' => $this->database(), 'webserver' => $this->webserver(), 'update_kanal' => $this->channels->active(), 'cache' => (string) config('cache.default'), 'queue' => (string) config('queue.default'), 'sprache' => app()->getLocale(), 'opcache' => function_exists('opcache_get_status') && @opcache_get_status(false) ? 'an' : 'aus', ], fn ($value) => $value !== null && $value !== ''), ]; } private function database(): ?string { try { $version = (string) DB::selectOne('select version() as v')->v; return (str_contains(strtolower($version), 'mariadb') ? 'MariaDB ' : 'MySQL ').preg_replace('/-.*$/', '', $version); } catch (Throwable) { return null; } } private function webserver(): ?string { $software = (string) ($_SERVER['SERVER_SOFTWARE'] ?? ''); // Nur Produkt und Version, keine Modul-Liste. return $software !== '' ? strtok($software, ' ') : PHP_SAPI; } }