nextcloud/lib/private/GlobalScale/Config.php
provokateurin f12cecb684
feat(rector): Enable SafeDeclareStrictTypesRector
Signed-off-by: provokateurin <kate@provokateurin.de>
2026-02-09 10:59:31 +01:00

37 lines
822 B
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OC\GlobalScale;
use OCP\IConfig;
use Override;
class Config implements \OCP\GlobalScale\IConfig {
public function __construct(
private readonly IConfig $config,
) {
}
#[Override]
public function isGlobalScaleEnabled(): bool {
return $this->config->getSystemValueBool('gs.enabled', false);
}
#[Override]
public function onlyInternalFederation(): bool {
// if global scale is disabled federation works always globally
$gsEnabled = $this->isGlobalScaleEnabled();
if ($gsEnabled === false) {
return false;
}
$enabled = $this->config->getSystemValueString('gs.federation', 'internal');
return $enabled === 'internal';
}
}