nextcloud/lib/private/GlobalScale/Config.php
Carl Schwan 3979c493f9
refactor: Apply second batch of comments
Signed-off-by: Carl Schwan <carl.schwan@nextcloud.com>
2026-02-06 13:52:51 +01:00

35 lines
796 B
PHP

<?php
/**
* 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';
}
}