mirror of
https://github.com/nextcloud/server.git
synced 2026-02-23 01:40:59 -05:00
37 lines
822 B
PHP
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';
|
|
}
|
|
}
|