settings->get('updates.auto', false); } public function setEnabled(bool $enabled): void { $this->settings->set('updates.auto', $enabled); } /** * @return array{sha: string, files: int, pending: bool}|null null, wenn nichts installiert wurde */ public function run(): ?array { if (! $this->enabled() || $this->progress->isRunning()) { return null; } try { $result = $this->check->run(); } catch (Throwable $e) { Log::warning('Automatisches Update: Prüfung fehlgeschlagen: '.$e->getMessage()); return null; } if (! $result['has_update'] || ($result['channel_switch']['direction'] ?? null) === 'back') { return null; } @set_time_limit(0); @ignore_user_abort(true); Log::info('Automatisches Update auf '.($result['version'] ?? $result['latest_short']).' beginnt.'); return app(Updater::class)->installUpdate(); } }