mirror of
https://github.com/nextcloud/all-in-one.git
synced 2026-02-04 13:06:53 +00:00
Make isFulltextsearchEnabled an attribute
Signed-off-by: Pablo Zmdl <pablo@nextcloud.com>
This commit is contained in:
parent
f16f5b233d
commit
f737d2f598
5 changed files with 11 additions and 29 deletions
|
|
@ -98,6 +98,12 @@ class ConfigurationManager
|
|||
set { $this->set('isImaginaryEnabled', $value); }
|
||||
}
|
||||
|
||||
public bool $isFulltextsearchEnabled {
|
||||
get => $this->get('isFulltextsearchEnabled', false);
|
||||
// Elasticsearch does not work on kernels without seccomp anymore. See https://github.com/nextcloud/all-in-one/discussions/5768
|
||||
set { $this->set('isFulltextsearchEnabled', ($this->isSeccompDisabled() && $value)); }
|
||||
}
|
||||
|
||||
public function GetConfig() : array
|
||||
{
|
||||
if ($this->config === [] && file_exists(DataConst::GetConfigFile()))
|
||||
|
|
@ -233,26 +239,6 @@ class ConfigurationManager
|
|||
}
|
||||
}
|
||||
|
||||
public function isFulltextsearchEnabled() : bool {
|
||||
$config = $this->GetConfig();
|
||||
if (isset($config['isFulltextsearchEnabled']) && $config['isFulltextsearchEnabled'] === 1) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public function SetFulltextsearchEnabledState(int $value) : void {
|
||||
// Elasticsearch does not work on kernels without seccomp anymore. See https://github.com/nextcloud/all-in-one/discussions/5768
|
||||
if ($this->isSeccompDisabled()) {
|
||||
$value = 0;
|
||||
}
|
||||
|
||||
$config = $this->GetConfig();
|
||||
$config['isFulltextsearchEnabled'] = $value;
|
||||
$this->WriteConfig($config);
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws InvalidSettingConfigurationException
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue