Make isClamavEnabled an attribute

Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
Pablo Zmdl 2026-01-19 12:01:53 +01:00
parent bebae7069b
commit f8a244bee2
5 changed files with 10 additions and 24 deletions

View file

@ -68,6 +68,11 @@ class ConfigurationManager
set { $this->set('install_latest_major', $value); }
}
public bool $isClamavEnabled {
get => $this->get('isClamavEnabled', false);
set { $this->set('isClamavEnabled', $value); }
}
public function GetConfig() : array
{
if ($this->config === [] && file_exists(DataConst::GetConfigFile()))
@ -203,21 +208,6 @@ class ConfigurationManager
}
}
public function isClamavEnabled() : bool {
$config = $this->GetConfig();
if (isset($config['isClamavEnabled']) && $config['isClamavEnabled'] === 1) {
return true;
} else {
return false;
}
}
public function SetClamavEnabledState(int $value) : void {
$config = $this->GetConfig();
$config['isClamavEnabled'] = $value;
$this->WriteConfig($config);
}
public function isImaginaryEnabled() : bool {
$config = $this->GetConfig();
if (isset($config['isImaginaryEnabled']) && $config['isImaginaryEnabled'] === 0) {