config = json_decode(file_get_contents($configFile), true) ?? []; } if (file_exists($channelsFile)) { $this->channels = json_decode(file_get_contents($channelsFile), true) ?? []; } } public function get(string $key, mixed $default = null): mixed { return $this->config[$key] ?? $default; } public function getChannels(): array { return $this->channels; } public function saveChannels(array $channels): void { file_put_contents( '/var/www/config/channels.json', json_encode($channels, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE) ); } }