mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 01:30:50 -04:00
Merge pull request #37596 from nextcloud/enh/type-iconfig-getter-calls
Use typed version of IConfig::getSystemValue as much as possible
This commit is contained in:
commit
ccab101df8
105 changed files with 483 additions and 457 deletions
|
|
@ -569,7 +569,7 @@ class OC {
|
|||
self::sendSameSiteCookies();
|
||||
// Debug mode gets access to the resources without strict cookie
|
||||
// due to the fact that the SabreDAV browser also lives there.
|
||||
if (!$config->getSystemValue('debug', false)) {
|
||||
if (!$config->getSystemValueBool('debug', false)) {
|
||||
http_response_code(\OCP\AppFramework\Http::STATUS_PRECONDITION_FAILED);
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(['error' => 'Strict Cookie has not been found in request']);
|
||||
|
|
@ -674,7 +674,7 @@ class OC {
|
|||
\OCP\Server::get(\Psr\Log\LoggerInterface::class),
|
||||
);
|
||||
$exceptionHandler = [$errorHandler, 'onException'];
|
||||
if ($config->getSystemValue('debug', false)) {
|
||||
if ($config->getSystemValueBool('debug', false)) {
|
||||
set_error_handler([$errorHandler, 'onAll'], E_ALL);
|
||||
if (\OC::$CLI) {
|
||||
$exceptionHandler = ['OC_Template', 'printExceptionErrorPage'];
|
||||
|
|
@ -735,7 +735,7 @@ class OC {
|
|||
echo('Writing to database failed');
|
||||
}
|
||||
exit(1);
|
||||
} elseif (self::$CLI && $config->getSystemValue('installed', false)) {
|
||||
} elseif (self::$CLI && $config->getSystemValueBool('installed', false)) {
|
||||
$config->deleteAppValue('core', 'cronErrors');
|
||||
}
|
||||
}
|
||||
|
|
@ -805,7 +805,7 @@ class OC {
|
|||
*/
|
||||
if (!OC::$CLI
|
||||
&& !Server::get(\OC\Security\TrustedDomainHelper::class)->isTrustedDomain($host)
|
||||
&& $config->getSystemValue('installed', false)
|
||||
&& $config->getSystemValueBool('installed', false)
|
||||
) {
|
||||
// Allow access to CSS resources
|
||||
$isScssRequest = false;
|
||||
|
|
|
|||
|
|
@ -62,10 +62,10 @@ abstract class Fetcher {
|
|||
protected $fileName;
|
||||
/** @var string */
|
||||
protected $endpointName;
|
||||
/** @var string */
|
||||
protected $version;
|
||||
/** @var string */
|
||||
protected $channel;
|
||||
/** @var ?string */
|
||||
protected $version = null;
|
||||
/** @var ?string */
|
||||
protected $channel = null;
|
||||
|
||||
public function __construct(Factory $appDataFactory,
|
||||
IClientService $clientService,
|
||||
|
|
@ -149,7 +149,7 @@ abstract class Fetcher {
|
|||
*/
|
||||
public function get($allowUnstable = false) {
|
||||
$appstoreenabled = $this->config->getSystemValueBool('appstoreenabled', true);
|
||||
$internetavailable = $this->config->getSystemValue('has_internet_connection', true);
|
||||
$internetavailable = $this->config->getSystemValueBool('has_internet_connection', true);
|
||||
|
||||
if (!$appstoreenabled || !$internetavailable) {
|
||||
return [];
|
||||
|
|
@ -218,7 +218,7 @@ abstract class Fetcher {
|
|||
*/
|
||||
protected function getVersion() {
|
||||
if ($this->version === null) {
|
||||
$this->version = $this->config->getSystemValue('version', '0.0.0');
|
||||
$this->version = $this->config->getSystemValueString('version', '0.0.0');
|
||||
}
|
||||
return $this->version;
|
||||
}
|
||||
|
|
@ -251,6 +251,6 @@ abstract class Fetcher {
|
|||
}
|
||||
|
||||
protected function getEndpoint(): string {
|
||||
return $this->config->getSystemValue('appstoreurl', 'https://apps.nextcloud.com/api/v1') . '/' . $this->endpointName;
|
||||
return $this->config->getSystemValueString('appstoreurl', 'https://apps.nextcloud.com/api/v1') . '/' . $this->endpointName;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class Platform {
|
|||
}
|
||||
|
||||
public function getDatabase(): string {
|
||||
$dbType = $this->config->getSystemValue('dbtype', 'sqlite');
|
||||
$dbType = $this->config->getSystemValueString('dbtype', 'sqlite');
|
||||
if ($dbType === 'sqlite3') {
|
||||
$dbType = 'sqlite';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -624,7 +624,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* @return bool
|
||||
*/
|
||||
private function isOverwriteCondition(string $type = ''): bool {
|
||||
$regex = '/' . $this->config->getSystemValue('overwritecondaddr', '') . '/';
|
||||
$regex = '/' . $this->config->getSystemValueString('overwritecondaddr', '') . '/';
|
||||
$remoteAddr = isset($this->server['REMOTE_ADDR']) ? $this->server['REMOTE_ADDR'] : '';
|
||||
return $regex === '//' || preg_match($regex, $remoteAddr) === 1
|
||||
|| $type !== 'protocol';
|
||||
|
|
@ -636,9 +636,9 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* @return string Server protocol (http or https)
|
||||
*/
|
||||
public function getServerProtocol(): string {
|
||||
if ($this->config->getSystemValue('overwriteprotocol') !== ''
|
||||
if ($this->config->getSystemValueString('overwriteprotocol') !== ''
|
||||
&& $this->isOverwriteCondition('protocol')) {
|
||||
return $this->config->getSystemValue('overwriteprotocol');
|
||||
return $this->config->getSystemValueString('overwriteprotocol');
|
||||
}
|
||||
|
||||
if ($this->fromTrustedProxy() && isset($this->server['HTTP_X_FORWARDED_PROTO'])) {
|
||||
|
|
@ -696,7 +696,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
*/
|
||||
public function getRequestUri(): string {
|
||||
$uri = isset($this->server['REQUEST_URI']) ? $this->server['REQUEST_URI'] : '';
|
||||
if ($this->config->getSystemValue('overwritewebroot') !== '' && $this->isOverwriteCondition()) {
|
||||
if ($this->config->getSystemValueString('overwritewebroot') !== '' && $this->isOverwriteCondition()) {
|
||||
$uri = $this->getScriptName() . substr($uri, \strlen($this->server['SCRIPT_NAME']));
|
||||
}
|
||||
return $uri;
|
||||
|
|
@ -764,7 +764,7 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
*/
|
||||
public function getScriptName(): string {
|
||||
$name = $this->server['SCRIPT_NAME'];
|
||||
$overwriteWebRoot = $this->config->getSystemValue('overwritewebroot');
|
||||
$overwriteWebRoot = $this->config->getSystemValueString('overwritewebroot');
|
||||
if ($overwriteWebRoot !== '' && $this->isOverwriteCondition()) {
|
||||
// FIXME: This code is untestable due to __DIR__, also that hardcoded path is really dangerous
|
||||
$serverRoot = str_replace('\\', '/', substr(__DIR__, 0, -\strlen('lib/private/appframework/http/')));
|
||||
|
|
@ -859,8 +859,8 @@ class Request implements \ArrayAccess, \Countable, IRequest {
|
|||
* isn't met
|
||||
*/
|
||||
private function getOverwriteHost() {
|
||||
if ($this->config->getSystemValue('overwritehost') !== '' && $this->isOverwriteCondition()) {
|
||||
return $this->config->getSystemValue('overwritehost');
|
||||
if ($this->config->getSystemValueString('overwritehost') !== '' && $this->isOverwriteCondition()) {
|
||||
return $this->config->getSystemValueString('overwritehost');
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class FinishRememberedLoginCommand extends ALoginCommand {
|
|||
}
|
||||
|
||||
public function process(LoginData $loginData): LoginResult {
|
||||
if ($loginData->isRememberLogin() && $this->config->getSystemValue('auto_logout', false) === false) {
|
||||
if ($loginData->isRememberLogin() && !$this->config->getSystemValueBool('auto_logout', false)) {
|
||||
$this->userSession->createRememberMeToken($loginData->getUser());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -265,10 +265,10 @@ class PublicKeyTokenProvider implements IProvider {
|
|||
public function invalidateOldTokens() {
|
||||
$this->cache->clear();
|
||||
|
||||
$olderThan = $this->time->getTime() - (int) $this->config->getSystemValue('session_lifetime', 60 * 60 * 24);
|
||||
$olderThan = $this->time->getTime() - $this->config->getSystemValueInt('session_lifetime', 60 * 60 * 24);
|
||||
$this->logger->debug('Invalidating session tokens older than ' . date('c', $olderThan), ['app' => 'cron']);
|
||||
$this->mapper->invalidateOld($olderThan, IToken::DO_NOT_REMEMBER);
|
||||
$rememberThreshold = $this->time->getTime() - (int) $this->config->getSystemValue('remember_login_cookie_lifetime', 60 * 60 * 24 * 15);
|
||||
$rememberThreshold = $this->time->getTime() - $this->config->getSystemValueInt('remember_login_cookie_lifetime', 60 * 60 * 24 * 15);
|
||||
$this->logger->debug('Invalidating remembered session tokens older than ' . date('c', $rememberThreshold), ['app' => 'cron']);
|
||||
$this->mapper->invalidateOld($rememberThreshold, IToken::REMEMBER);
|
||||
}
|
||||
|
|
@ -366,7 +366,7 @@ class PublicKeyTokenProvider implements IProvider {
|
|||
}
|
||||
|
||||
private function encrypt(string $plaintext, string $token): string {
|
||||
$secret = $this->config->getSystemValue('secret');
|
||||
$secret = $this->config->getSystemValueString('secret');
|
||||
return $this->crypto->encrypt($plaintext, $token . $secret);
|
||||
}
|
||||
|
||||
|
|
@ -374,7 +374,7 @@ class PublicKeyTokenProvider implements IProvider {
|
|||
* @throws InvalidTokenException
|
||||
*/
|
||||
private function decrypt(string $cipherText, string $token): string {
|
||||
$secret = $this->config->getSystemValue('secret');
|
||||
$secret = $this->config->getSystemValueString('secret');
|
||||
try {
|
||||
return $this->crypto->decrypt($cipherText, $token . $secret);
|
||||
} catch (\Exception $ex) {
|
||||
|
|
@ -404,7 +404,7 @@ class PublicKeyTokenProvider implements IProvider {
|
|||
}
|
||||
|
||||
private function hashToken(string $token): string {
|
||||
$secret = $this->config->getSystemValue('secret');
|
||||
$secret = $this->config->getSystemValueString('secret');
|
||||
return hash('sha512', $token . $secret);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class LookupPlugin implements ISearchPlugin {
|
|||
}
|
||||
|
||||
public function search($search, $limit, $offset, ISearchResult $searchResult) {
|
||||
$isGlobalScaleEnabled = $this->config->getSystemValue('gs.enabled', false);
|
||||
$isGlobalScaleEnabled = $this->config->getSystemValueBool('gs.enabled', false);
|
||||
$isLookupServerEnabled = $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'yes') === 'yes';
|
||||
$hasInternetConnection = $this->config->getSystemValueBool('has_internet_connection', true);
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ class LookupPlugin implements ISearchPlugin {
|
|||
return false;
|
||||
}
|
||||
|
||||
$lookupServerUrl = $this->config->getSystemValue('lookup_server', 'https://lookup.nextcloud.com');
|
||||
$lookupServerUrl = $this->config->getSystemValueString('lookup_server', 'https://lookup.nextcloud.com');
|
||||
if (empty($lookupServerUrl)) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ class Application {
|
|||
|
||||
try {
|
||||
require_once __DIR__ . '/../../../core/register_command.php';
|
||||
if ($this->config->getSystemValue('installed', false)) {
|
||||
if ($this->config->getSystemValueBool('installed', false)) {
|
||||
if (\OCP\Util::needUpgrade()) {
|
||||
throw new NeedsUpdateException();
|
||||
} elseif ($this->config->getSystemValueBool('maintenance')) {
|
||||
|
|
|
|||
|
|
@ -178,7 +178,7 @@ class Migrator {
|
|||
}
|
||||
|
||||
protected function getFilterExpression() {
|
||||
return '/^' . preg_quote($this->config->getSystemValue('dbtableprefix', 'oc_')) . '/';
|
||||
return '/^' . preg_quote($this->config->getSystemValueString('dbtableprefix', 'oc_')) . '/';
|
||||
}
|
||||
|
||||
protected function emit(string $sql, int $step, int $max): void {
|
||||
|
|
|
|||
|
|
@ -216,6 +216,6 @@ class OracleMigrator extends Migrator {
|
|||
}
|
||||
|
||||
protected function getFilterExpression() {
|
||||
return '/^"' . preg_quote($this->config->getSystemValue('dbtableprefix', 'oc_')) . '/';
|
||||
return '/^"' . preg_quote($this->config->getSystemValueString('dbtableprefix', 'oc_')) . '/';
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ class PgSqlTools {
|
|||
$databaseName = $conn->getDatabase();
|
||||
$conn->getConfiguration()->setSchemaAssetsFilter(function ($asset) {
|
||||
/** @var string|AbstractAsset $asset */
|
||||
$filterExpression = '/^' . preg_quote($this->config->getSystemValue('dbtableprefix', 'oc_')) . '/';
|
||||
$filterExpression = '/^' . preg_quote($this->config->getSystemValueString('dbtableprefix', 'oc_')) . '/';
|
||||
if ($asset instanceof AbstractAsset) {
|
||||
return preg_match($filterExpression, $asset->getName()) !== false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -237,7 +237,7 @@ class Storage implements IStorage {
|
|||
|
||||
if (!array_key_exists('uid', $data) || $data['uid'] !== $uid) {
|
||||
// If the migration is done we error out
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0.0');
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValueString('version', '0.0.0.0');
|
||||
if (version_compare($versionFromBeforeUpdate, '20.0.0.1', '<=')) {
|
||||
return $data['key'];
|
||||
}
|
||||
|
|
@ -272,7 +272,7 @@ class Storage implements IStorage {
|
|||
$data = $this->view->file_get_contents($path);
|
||||
|
||||
// Version <20.0.0.1 doesn't have this
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0.0');
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValueString('version', '0.0.0.0');
|
||||
if (version_compare($versionFromBeforeUpdate, '20.0.0.1', '<=')) {
|
||||
$key = [
|
||||
'key' => base64_encode($data),
|
||||
|
|
@ -335,7 +335,7 @@ class Storage implements IStorage {
|
|||
private function setKey($path, $key) {
|
||||
$this->keySetPreparation(dirname($path));
|
||||
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0.0');
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValueString('version', '0.0.0.0');
|
||||
if (version_compare($versionFromBeforeUpdate, '20.0.0.1', '<=')) {
|
||||
// Only store old format if this happens during the migration.
|
||||
// TODO: Remove for 21
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ class Manager implements IManager {
|
|||
* @return bool true if enabled, false if not
|
||||
*/
|
||||
public function isEnabled() {
|
||||
$installed = $this->config->getSystemValue('installed', false);
|
||||
$installed = $this->config->getSystemValueBool('installed', false);
|
||||
if (!$installed) {
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class Util {
|
|||
protected $config;
|
||||
|
||||
/** @var array paths excluded from encryption */
|
||||
protected $excludedPaths;
|
||||
protected array $excludedPaths = [];
|
||||
protected IGroupManager $groupManager;
|
||||
protected IUserManager $userManager;
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ class Util {
|
|||
$this->config = $config;
|
||||
|
||||
$this->excludedPaths[] = 'files_encryption';
|
||||
$this->excludedPaths[] = 'appdata_' . $config->getSystemValue('instanceid', null);
|
||||
$this->excludedPaths[] = 'appdata_' . $config->getSystemValueString('instanceid');
|
||||
$this->excludedPaths[] = 'files_external';
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class Scanner extends BasicEmitter implements IScanner {
|
|||
$this->storage = $storage;
|
||||
$this->storageId = $this->storage->getId();
|
||||
$this->cache = $storage->getCache();
|
||||
$this->cacheActive = !\OC::$server->getConfig()->getSystemValue('filesystem_cache_readonly', false);
|
||||
$this->cacheActive = !\OC::$server->getConfig()->getSystemValueBool('filesystem_cache_readonly', false);
|
||||
$this->lockingProvider = \OC::$server->getLockingProvider();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class CacheMountProvider implements IMountProvider {
|
|||
* @return \OCP\Files\Mount\IMountPoint[]
|
||||
*/
|
||||
public function getMountsForUser(IUser $user, IStorageFactory $loader) {
|
||||
$cacheBaseDir = $this->config->getSystemValue('cache_path', '');
|
||||
$cacheBaseDir = $this->config->getSystemValueString('cache_path', '');
|
||||
if ($cacheBaseDir !== '') {
|
||||
$cacheDir = rtrim($cacheBaseDir, '/') . '/' . $user->getUID();
|
||||
if (!file_exists($cacheDir)) {
|
||||
|
|
|
|||
|
|
@ -837,7 +837,7 @@ abstract class Common implements Storage, ILockingStorage, IWriteStreamStorage {
|
|||
|
||||
private function getLockLogger(): ?LoggerInterface {
|
||||
if (is_null($this->shouldLogLocks)) {
|
||||
$this->shouldLogLocks = \OC::$server->getConfig()->getSystemValue('filelocking.debug', false);
|
||||
$this->shouldLogLocks = \OC::$server->getConfig()->getSystemValueBool('filelocking.debug', false);
|
||||
$this->logger = $this->shouldLogLocks ? \OC::$server->get(LoggerInterface::class) : null;
|
||||
}
|
||||
return $this->logger;
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ class DAV extends Common {
|
|||
$settings['authType'] = $this->authType;
|
||||
}
|
||||
|
||||
$proxy = \OC::$server->getConfig()->getSystemValue('proxy', '');
|
||||
$proxy = \OC::$server->getConfig()->getSystemValueString('proxy', '');
|
||||
if ($proxy !== '') {
|
||||
$settings['proxy'] = $proxy;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class Local extends \OC\Files\Storage\Common {
|
|||
$this->defUMask = $this->config->getSystemValue('localstorage.umask', 0022);
|
||||
|
||||
// support Write-Once-Read-Many file systems
|
||||
$this->unlinkOnTruncate = $this->config->getSystemValue('localstorage.unlink_on_truncate', false);
|
||||
$this->unlinkOnTruncate = $this->config->getSystemValueBool('localstorage.unlink_on_truncate', false);
|
||||
}
|
||||
|
||||
public function __destruct() {
|
||||
|
|
@ -486,7 +486,7 @@ class Local extends \OC\Files\Storage\Common {
|
|||
|
||||
$fullPath = $this->datadir . $path;
|
||||
$currentPath = $path;
|
||||
$allowSymlinks = $this->config->getSystemValue('localstorage.allowsymlinks', false);
|
||||
$allowSymlinks = $this->config->getSystemValueBool('localstorage.allowsymlinks', false);
|
||||
if ($allowSymlinks || $currentPath === '') {
|
||||
return $fullPath;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -268,8 +268,8 @@ class TemplateManager implements ITemplateManager {
|
|||
|
||||
$defaultSkeletonDirectory = \OC::$SERVERROOT . '/core/skeleton';
|
||||
$defaultTemplateDirectory = \OC::$SERVERROOT . '/core/skeleton/Templates';
|
||||
$skeletonPath = $this->config->getSystemValue('skeletondirectory', $defaultSkeletonDirectory);
|
||||
$skeletonTemplatePath = $this->config->getSystemValue('templatedirectory', $defaultTemplateDirectory);
|
||||
$skeletonPath = $this->config->getSystemValueString('skeletondirectory', $defaultSkeletonDirectory);
|
||||
$skeletonTemplatePath = $this->config->getSystemValueString('templatedirectory', $defaultTemplateDirectory);
|
||||
$isDefaultSkeleton = $skeletonPath === $defaultSkeletonDirectory;
|
||||
$isDefaultTemplates = $skeletonTemplatePath === $defaultTemplateDirectory;
|
||||
$userLang = $this->l10nFactory->getUserLanguage($this->userManager->get($this->userId));
|
||||
|
|
|
|||
|
|
@ -44,8 +44,7 @@ class Config implements \OCP\GlobalScale\IConfig {
|
|||
* @return bool
|
||||
*/
|
||||
public function isGlobalScaleEnabled() {
|
||||
$enabled = $this->config->getSystemValue('gs.enabled', false);
|
||||
return $enabled !== false;
|
||||
return $this->config->getSystemValueBool('gs.enabled', false);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -61,7 +60,7 @@ class Config implements \OCP\GlobalScale\IConfig {
|
|||
return false;
|
||||
}
|
||||
|
||||
$enabled = $this->config->getSystemValue('gs.federation', 'internal');
|
||||
$enabled = $this->config->getSystemValueString('gs.federation', 'internal');
|
||||
|
||||
return $enabled === 'internal';
|
||||
}
|
||||
|
|
|
|||
|
|
@ -122,7 +122,7 @@ class Client implements IClient {
|
|||
// If the instance is not yet setup we need to use the static path as
|
||||
// $this->certificateManager->getAbsoluteBundlePath() tries to instantiate
|
||||
// a view
|
||||
if ($this->config->getSystemValue('installed', false) === false) {
|
||||
if (!$this->config->getSystemValueBool('installed', false)) {
|
||||
return \OC::$SERVERROOT . '/resources/config/ca-bundle.crt';
|
||||
}
|
||||
|
||||
|
|
@ -145,14 +145,14 @@ class Client implements IClient {
|
|||
*
|
||||
*/
|
||||
private function getProxyUri(): ?array {
|
||||
$proxyHost = $this->config->getSystemValue('proxy', '');
|
||||
$proxyHost = $this->config->getSystemValueString('proxy', '');
|
||||
|
||||
if ($proxyHost === '' || $proxyHost === null) {
|
||||
if ($proxyHost === '') {
|
||||
return null;
|
||||
}
|
||||
|
||||
$proxyUserPwd = $this->config->getSystemValue('proxyuserpwd', '');
|
||||
if ($proxyUserPwd !== '' && $proxyUserPwd !== null) {
|
||||
$proxyUserPwd = $this->config->getSystemValueString('proxyuserpwd', '');
|
||||
if ($proxyUserPwd !== '') {
|
||||
$proxyHost = $proxyUserPwd . '@' . $proxyHost;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -116,9 +116,9 @@ class Checker {
|
|||
*/
|
||||
$isIntegrityCheckDisabled = false;
|
||||
if ($this->config !== null) {
|
||||
$isIntegrityCheckDisabled = $this->config->getSystemValue('integrity.check.disabled', false);
|
||||
$isIntegrityCheckDisabled = $this->config->getSystemValueBool('integrity.check.disabled', false);
|
||||
}
|
||||
if ($isIntegrityCheckDisabled === true) {
|
||||
if ($isIntegrityCheckDisabled) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class ExcludeFoldersByPathFilterIterator extends \RecursiveFilterIterator {
|
|||
rtrim($root . '/updater', '/'),
|
||||
rtrim($root . '/_oc_upgrade', '/'),
|
||||
];
|
||||
$customDataDir = \OC::$server->getConfig()->getSystemValue('datadirectory', '');
|
||||
$customDataDir = \OC::$server->getConfig()->getSystemValueString('datadirectory', '');
|
||||
if ($customDataDir !== '') {
|
||||
$excludedFolders[] = rtrim($customDataDir, '/');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ class Factory implements IFactory {
|
|||
*
|
||||
* @link https://github.com/owncloud/core/issues/21955
|
||||
*/
|
||||
if ($this->config->getSystemValue('installed', false)) {
|
||||
if ($this->config->getSystemValueBool('installed', false)) {
|
||||
$userId = !is_null($this->userSession->getUser()) ? $this->userSession->getUser()->getUID() : null;
|
||||
if (!is_null($userId)) {
|
||||
$userLang = $this->config->getUserValue($userId, 'core', 'lang', null);
|
||||
|
|
@ -247,7 +247,7 @@ class Factory implements IFactory {
|
|||
}
|
||||
|
||||
// Step 3.1: Check if Nextcloud is already installed before we try to access user info
|
||||
if (!$this->config->getSystemValue('installed', false)) {
|
||||
if (!$this->config->getSystemValueBool('installed', false)) {
|
||||
return 'en';
|
||||
}
|
||||
// Step 3.2: Check the current user (if any) for their preferred language
|
||||
|
|
@ -282,7 +282,7 @@ class Factory implements IFactory {
|
|||
return $forceLocale;
|
||||
}
|
||||
|
||||
if ($this->config->getSystemValue('installed', false)) {
|
||||
if ($this->config->getSystemValueBool('installed', false)) {
|
||||
$userId = null !== $this->userSession->getUser() ? $this->userSession->getUser()->getUID() : null;
|
||||
$userLocale = null;
|
||||
if (null !== $userId) {
|
||||
|
|
@ -366,7 +366,7 @@ class Factory implements IFactory {
|
|||
}
|
||||
|
||||
// merge with translations from theme
|
||||
$theme = $this->config->getSystemValue('theme');
|
||||
$theme = $this->config->getSystemValueString('theme');
|
||||
if (!empty($theme)) {
|
||||
$themeDir = $this->serverRoot . '/themes/' . $theme . substr($dir, strlen($this->serverRoot));
|
||||
|
||||
|
|
@ -452,7 +452,7 @@ class Factory implements IFactory {
|
|||
}
|
||||
}
|
||||
|
||||
return $this->config->getSystemValue('default_language', 'en');
|
||||
return $this->config->getSystemValueString('default_language', 'en');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -576,7 +576,7 @@ class Factory implements IFactory {
|
|||
}
|
||||
|
||||
// merge with translations from theme
|
||||
$theme = $this->config->getSystemValue('theme');
|
||||
$theme = $this->config->getSystemValueString('theme');
|
||||
if (!empty($theme)) {
|
||||
$transFile = $this->serverRoot . '/themes/' . $theme . substr($transFile, strlen($this->serverRoot));
|
||||
if (file_exists($transFile)) {
|
||||
|
|
|
|||
|
|
@ -93,10 +93,10 @@ class LanguageIterator implements ILanguageIterator {
|
|||
$this->next();
|
||||
// no break
|
||||
case 4:
|
||||
return $this->config->getSystemValue('default_language', 'en');
|
||||
return $this->config->getSystemValueString('default_language', 'en');
|
||||
/** @noinspection PhpMissingBreakStatementInspection */
|
||||
case 5:
|
||||
$defaultLang = $this->config->getSystemValue('default_language', 'en');
|
||||
$defaultLang = $this->config->getSystemValueString('default_language', 'en');
|
||||
if (($truncated = $this->getTruncatedLanguage($defaultLang)) !== $defaultLang) {
|
||||
return $truncated;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ class Rotate extends \OCP\BackgroundJob\Job {
|
|||
$systemConfig = \OC::$server->getSystemConfig();
|
||||
$this->filePath = $systemConfig->getValue('logfile', $systemConfig->getValue('datadirectory', \OC::$SERVERROOT . '/data') . '/nextcloud.log');
|
||||
|
||||
$this->maxSize = \OC::$server->getConfig()->getSystemValue('log_rotate_size', 100 * 1024 * 1024);
|
||||
$this->maxSize = \OC::$server->getConfig()->getSystemValueInt('log_rotate_size', 100 * 1024 * 1024);
|
||||
if ($this->shouldRotateBySize()) {
|
||||
$rotatedFile = $this->rotate();
|
||||
$msg = 'Log file "'.$this->filePath.'" was over '.$this->maxSize.' bytes, moved to "'.$rotatedFile.'"';
|
||||
|
|
|
|||
|
|
@ -57,7 +57,6 @@ use Symfony\Component\Mailer\Transport\SendmailTransport;
|
|||
use Symfony\Component\Mailer\Transport\Smtp\EsmtpTransport;
|
||||
use Symfony\Component\Mailer\Transport\Smtp\Stream\SocketStream;
|
||||
use Symfony\Component\Mime\Email;
|
||||
use Symfony\Component\Mime\Exception\InvalidArgumentException;
|
||||
use Symfony\Component\Mime\Exception\RfcComplianceException;
|
||||
|
||||
/**
|
||||
|
|
@ -110,7 +109,7 @@ class Mailer implements IMailer {
|
|||
* @return Message
|
||||
*/
|
||||
public function createMessage(): Message {
|
||||
$plainTextOnly = $this->config->getSystemValue('mail_send_plaintext_only', false);
|
||||
$plainTextOnly = $this->config->getSystemValueBool('mail_send_plaintext_only', false);
|
||||
return new Message(new Email(), $plainTextOnly);
|
||||
}
|
||||
|
||||
|
|
@ -144,7 +143,7 @@ class Mailer implements IMailer {
|
|||
* @since 12.0.0
|
||||
*/
|
||||
public function createEMailTemplate(string $emailId, array $data = []): IEMailTemplate {
|
||||
$class = $this->config->getSystemValue('mail_template_class', '');
|
||||
$class = $this->config->getSystemValueString('mail_template_class', '');
|
||||
|
||||
if ($class !== '' && class_exists($class) && is_a($class, EMailTemplate::class, true)) {
|
||||
return new $class(
|
||||
|
|
@ -176,10 +175,10 @@ class Mailer implements IMailer {
|
|||
* @return string[] $failedRecipients
|
||||
*/
|
||||
public function send(IMessage $message): array {
|
||||
$debugMode = $this->config->getSystemValue('mail_smtpdebug', false);
|
||||
$debugMode = $this->config->getSystemValueBool('mail_smtpdebug', false);
|
||||
|
||||
if (!($message instanceof Message)) {
|
||||
throw new InvalidArgumentException('Object not of type ' . Message::class);
|
||||
throw new \InvalidArgumentException('Object not of type ' . Message::class);
|
||||
}
|
||||
|
||||
if (empty($message->getFrom())) {
|
||||
|
|
@ -192,7 +191,7 @@ class Mailer implements IMailer {
|
|||
|
||||
try {
|
||||
$message->setRecipients();
|
||||
} catch (InvalidArgumentException|RfcComplianceException $e) {
|
||||
} catch (\InvalidArgumentException|RfcComplianceException $e) {
|
||||
$logMessage = sprintf(
|
||||
'Could not send mail to "%s" with subject "%s" as validation for address failed',
|
||||
print_r(array_merge($message->getTo(), $message->getCc(), $message->getBcc()), true),
|
||||
|
|
@ -267,7 +266,7 @@ class Mailer implements IMailer {
|
|||
|
||||
$transport = null;
|
||||
|
||||
switch ($this->config->getSystemValue('mail_smtpmode', 'smtp')) {
|
||||
switch ($this->config->getSystemValueString('mail_smtpmode', 'smtp')) {
|
||||
case 'sendmail':
|
||||
$transport = $this->getSendMailInstance();
|
||||
break;
|
||||
|
|
@ -294,7 +293,7 @@ class Mailer implements IMailer {
|
|||
$mailSmtpsecure = ($this->config->getSystemValue('mail_smtpsecure', null) === 'ssl') ? true : null;
|
||||
$transport = new EsmtpTransport(
|
||||
$this->config->getSystemValue('mail_smtphost', '127.0.0.1'),
|
||||
(int)$this->config->getSystemValue('mail_smtpport', 25),
|
||||
$this->config->getSystemValueInt('mail_smtpport', 25),
|
||||
$mailSmtpsecure,
|
||||
null,
|
||||
$this->logger
|
||||
|
|
@ -304,7 +303,7 @@ class Mailer implements IMailer {
|
|||
/** @psalm-suppress InternalMethod */
|
||||
$stream->setTimeout($this->config->getSystemValue('mail_smtptimeout', 10));
|
||||
|
||||
if ($this->config->getSystemValue('mail_smtpauth', false)) {
|
||||
if ($this->config->getSystemValueBool('mail_smtpauth', false)) {
|
||||
$transport->setUsername($this->config->getSystemValue('mail_smtpname', ''));
|
||||
$transport->setPassword($this->config->getSystemValue('mail_smtppassword', ''));
|
||||
}
|
||||
|
|
@ -338,7 +337,7 @@ class Mailer implements IMailer {
|
|||
* @return SendmailTransport
|
||||
*/
|
||||
protected function getSendMailInstance(): SendmailTransport {
|
||||
switch ($this->config->getSystemValue('mail_smtpmode', 'smtp')) {
|
||||
switch ($this->config->getSystemValueString('mail_smtpmode', 'smtp')) {
|
||||
case 'qmail':
|
||||
$binaryPath = '/var/qmail/bin/sendmail';
|
||||
break;
|
||||
|
|
@ -351,7 +350,7 @@ class Mailer implements IMailer {
|
|||
break;
|
||||
}
|
||||
|
||||
switch ($this->config->getSystemValue('mail_sendmailmode', 'smtp')) {
|
||||
switch ($this->config->getSystemValueString('mail_sendmailmode', 'smtp')) {
|
||||
case 'pipe':
|
||||
$binaryParam = ' -t';
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ class NavigationManager implements INavigationManager {
|
|||
$this->init = true;
|
||||
|
||||
$l = $this->l10nFac->get('lib');
|
||||
if ($this->config->getSystemValue('knowledgebaseenabled', true)) {
|
||||
if ($this->config->getSystemValueBool('knowledgebaseenabled', true)) {
|
||||
$this->add([
|
||||
'type' => 'settings',
|
||||
'id' => 'help',
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class Imaginary extends ProviderV2 {
|
|||
}
|
||||
|
||||
public function getCroppedThumbnail(File $file, int $maxX, int $maxY, bool $crop): ?IImage {
|
||||
$maxSizeForImages = $this->config->getSystemValue('preview_max_filesize_image', 50);
|
||||
$maxSizeForImages = $this->config->getSystemValueInt('preview_max_filesize_image', 50);
|
||||
|
||||
$size = $file->getSize();
|
||||
|
||||
|
|
@ -105,7 +105,7 @@ class Imaginary extends ProviderV2 {
|
|||
default:
|
||||
$mimeType = 'jpeg';
|
||||
}
|
||||
|
||||
|
||||
$operations = [];
|
||||
|
||||
if ($convert) {
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ class PreviewManager implements IPreview {
|
|||
* @return void
|
||||
*/
|
||||
public function registerProvider($mimeTypeRegex, \Closure $callable): void {
|
||||
if (!$this->config->getSystemValue('enable_previews', true)) {
|
||||
if (!$this->config->getSystemValueBool('enable_previews', true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -128,7 +128,7 @@ class PreviewManager implements IPreview {
|
|||
* Get all providers
|
||||
*/
|
||||
public function getProviders(): array {
|
||||
if (!$this->config->getSystemValue('enable_previews', true)) {
|
||||
if (!$this->config->getSystemValueBool('enable_previews', true)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
@ -219,7 +219,7 @@ class PreviewManager implements IPreview {
|
|||
* @return boolean
|
||||
*/
|
||||
public function isMimeSupported($mimeType = '*') {
|
||||
if (!$this->config->getSystemValue('enable_previews', true)) {
|
||||
if (!$this->config->getSystemValueBool('enable_previews', true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -244,7 +244,7 @@ class PreviewManager implements IPreview {
|
|||
* Check if a preview can be generated for a file
|
||||
*/
|
||||
public function isAvailable(\OCP\Files\FileInfo $file): bool {
|
||||
if (!$this->config->getSystemValue('enable_previews', true)) {
|
||||
if (!$this->config->getSystemValueBool('enable_previews', true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class ClearGeneratedAvatarCache implements IRepairStep {
|
|||
* Check if this repair step should run
|
||||
*/
|
||||
private function shouldRun(): bool {
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0.0');
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValueString('version', '0.0.0.0');
|
||||
|
||||
// was added to 25.0.0.10
|
||||
return version_compare($versionFromBeforeUpdate, '25.0.0.10', '<=');
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ class Collation implements IRepairStep {
|
|||
return;
|
||||
}
|
||||
|
||||
$characterSet = $this->config->getSystemValue('mysql.utf8mb4', false) ? 'utf8mb4' : 'utf8';
|
||||
$characterSet = $this->config->getSystemValueBool('mysql.utf8mb4', false) ? 'utf8mb4' : 'utf8';
|
||||
|
||||
$tables = $this->getAllNonUTF8BinTables($this->connection);
|
||||
foreach ($tables as $table) {
|
||||
|
|
@ -112,8 +112,8 @@ class Collation implements IRepairStep {
|
|||
* @return string[]
|
||||
*/
|
||||
protected function getAllNonUTF8BinTables(IDBConnection $connection) {
|
||||
$dbName = $this->config->getSystemValue("dbname");
|
||||
$characterSet = $this->config->getSystemValue('mysql.utf8mb4', false) ? 'utf8mb4' : 'utf8';
|
||||
$dbName = $this->config->getSystemValueString("dbname");
|
||||
$characterSet = $this->config->getSystemValueBool('mysql.utf8mb4', false) ? 'utf8mb4' : 'utf8';
|
||||
|
||||
// fetch tables by columns
|
||||
$statement = $connection->executeQuery(
|
||||
|
|
|
|||
|
|
@ -43,9 +43,9 @@ class MoveUpdaterStepFile implements IRepairStep {
|
|||
|
||||
public function run(IOutput $output) {
|
||||
$updateDir = $this->config->getSystemValue('updatedirectory', null) ?? $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data');
|
||||
$instanceId = $this->config->getSystemValue('instanceid', null);
|
||||
$instanceId = $this->config->getSystemValueString('instanceid');
|
||||
|
||||
if (!is_string($instanceId) || empty($instanceId)) {
|
||||
if (empty($instanceId)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ class CleanupCardDAVPhotoCache implements IRepairStep {
|
|||
|
||||
private function shouldRun(): bool {
|
||||
return version_compare(
|
||||
$this->config->getSystemValue('version', '0.0.0.0'),
|
||||
$this->config->getSystemValueString('version', '0.0.0.0'),
|
||||
'16.0.0.0',
|
||||
'<='
|
||||
);
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class ClearCollectionsAccessCache implements IRepairStep {
|
|||
}
|
||||
|
||||
private function shouldRun(): bool {
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0.0');
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValueString('version', '0.0.0.0');
|
||||
return version_compare($versionFromBeforeUpdate, '17.0.0.3', '<=');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ class ResetGeneratedAvatarFlag implements IRepairStep {
|
|||
}
|
||||
|
||||
private function shouldRun(): bool {
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0.0');
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValueString('version', '0.0.0.0');
|
||||
return version_compare($versionFromBeforeUpdate, '18.0.0.5', '<=');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class EncryptionLegacyCipher implements IRepairStep {
|
|||
}
|
||||
|
||||
private function shouldRun(): bool {
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0.0');
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValueString('version', '0.0.0.0');
|
||||
return version_compare($versionFromBeforeUpdate, '20.0.0.0', '<=');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class EncryptionMigration implements IRepairStep {
|
|||
}
|
||||
|
||||
private function shouldRun(): bool {
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0.0');
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValueString('version', '0.0.0.0');
|
||||
return version_compare($versionFromBeforeUpdate, '20.0.0.1', '<=');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ class AddCheckForUserCertificatesJob implements IRepairStep {
|
|||
}
|
||||
|
||||
private function shouldRun() {
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0.0');
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValueString('version', '0.0.0.0');
|
||||
|
||||
// was added to 21.0.0.2
|
||||
return version_compare($versionFromBeforeUpdate, '21.0.0.2', '<');
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class LookupServerSendCheck implements IRepairStep {
|
|||
}
|
||||
|
||||
private function shouldRun(): bool {
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0.0');
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValueString('version', '0.0.0.0');
|
||||
|
||||
// was added to 22.0.0.3
|
||||
return (version_compare($versionFromBeforeUpdate, '22.0.0.3', '<') && version_compare($versionFromBeforeUpdate, '22.0.0.0', '>='))
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ class AddMissingSecretJob implements IRepairStep {
|
|||
}
|
||||
|
||||
public function run(IOutput $output): void {
|
||||
$passwordSalt = $this->config->getSystemValue('passwordsalt', null);
|
||||
if ($passwordSalt === null || $passwordSalt === '') {
|
||||
$passwordSalt = $this->config->getSystemValueString('passwordsalt', '');
|
||||
if ($passwordSalt === '') {
|
||||
try {
|
||||
$this->config->setSystemValue('passwordsalt', $this->random->generate(30));
|
||||
} catch (HintException $e) {
|
||||
|
|
@ -51,8 +51,8 @@ class AddMissingSecretJob implements IRepairStep {
|
|||
}
|
||||
}
|
||||
|
||||
$secret = $this->config->getSystemValue('secret', null);
|
||||
if ($secret === null || $secret === '') {
|
||||
$secret = $this->config->getSystemValueString('secret', '');
|
||||
if ($secret === '') {
|
||||
try {
|
||||
$this->config->setSystemValue('secret', $this->random->generate(48));
|
||||
} catch (HintException $e) {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ class MoveAvatars implements IRepairStep {
|
|||
$output->info('Repair step already executed');
|
||||
return;
|
||||
}
|
||||
if ($this->config->getSystemValue('enable_avatars', true) === false) {
|
||||
if (!$this->config->getSystemValueBool('enable_avatars', true)) {
|
||||
$output->info('Avatars are disabled');
|
||||
} else {
|
||||
$output->info('Add background job');
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ class SaveAccountsTableData implements IRepairStep {
|
|||
}
|
||||
|
||||
// oc_persistent_locks will be removed later on anyways so we can just drop and ignore any foreign key constraints here
|
||||
$tableName = $this->config->getSystemValue('dbtableprefix', 'oc_') . 'persistent_locks';
|
||||
$tableName = $this->config->getSystemValueString('dbtableprefix', 'oc_') . 'persistent_locks';
|
||||
$schema = $this->db->createSchema();
|
||||
$table = $schema->getTable($tableName);
|
||||
foreach ($table->getForeignKeys() as $foreignKey) {
|
||||
|
|
@ -99,7 +99,7 @@ class SaveAccountsTableData implements IRepairStep {
|
|||
*/
|
||||
protected function shouldRun() {
|
||||
$schema = $this->db->createSchema();
|
||||
$prefix = $this->config->getSystemValue('dbtableprefix', 'oc_');
|
||||
$prefix = $this->config->getSystemValueString('dbtableprefix', 'oc_');
|
||||
|
||||
$tableName = $prefix . 'accounts';
|
||||
if (!$schema->hasTable($tableName)) {
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ class UpdateLanguageCodes implements IRepairStep {
|
|||
* {@inheritdoc}
|
||||
*/
|
||||
public function run(IOutput $output) {
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0');
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValueString('version', '0.0.0');
|
||||
|
||||
if (version_compare($versionFromBeforeUpdate, '12.0.0.13', '>')) {
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class RemoveLinkShares implements IRepairStep {
|
|||
}
|
||||
|
||||
private function shouldRun(): bool {
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0');
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValueString('version', '0.0.0');
|
||||
|
||||
if (version_compare($versionFromBeforeUpdate, '14.0.11', '<')) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ class RepairDavShares implements IRepairStep {
|
|||
* @inheritDoc
|
||||
*/
|
||||
public function run(IOutput $output) {
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0');
|
||||
$versionFromBeforeUpdate = $this->config->getSystemValueString('version', '0.0.0');
|
||||
if (version_compare($versionFromBeforeUpdate, '20.0.8', '<')
|
||||
&& $this->repairUnencodedGroupShares()
|
||||
) {
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ class RepairInvalidShares implements IRepairStep {
|
|||
}
|
||||
|
||||
public function run(IOutput $out) {
|
||||
$ocVersionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0');
|
||||
$ocVersionFromBeforeUpdate = $this->config->getSystemValueString('version', '0.0.0');
|
||||
if (version_compare($ocVersionFromBeforeUpdate, '12.0.0.11', '<')) {
|
||||
$this->adjustFileSharePermissions($out);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ class RepairMimeTypes implements IRepairStep {
|
|||
* Fix mime types
|
||||
*/
|
||||
public function run(IOutput $out) {
|
||||
$ocVersionFromBeforeUpdate = $this->config->getSystemValue('version', '0.0.0');
|
||||
$ocVersionFromBeforeUpdate = $this->config->getSystemValueString('version', '0.0.0');
|
||||
|
||||
// NOTE TO DEVELOPERS: when adding new mime types, please make sure to
|
||||
// add a version comparison to avoid doing it every time
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ class Capabilities implements IPublicCapability, IInitialStateExcludedCapability
|
|||
}
|
||||
|
||||
public function getCapabilities(): array {
|
||||
if (version_compare(\OC::$server->getConfig()->getSystemValue('version', '0.0.0.0'), '12.0.0.0', '<')) {
|
||||
if (version_compare(\OC::$server->getConfig()->getSystemValueString('version', '0.0.0.0'), '12.0.0.0', '<')) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ class Throttler implements IThrottler {
|
|||
string $ip,
|
||||
array $metadata = []): void {
|
||||
// No need to log if the bruteforce protection is disabled
|
||||
if ($this->config->getSystemValue('auth.bruteforce.protection.enabled', true) === false) {
|
||||
if (!$this->config->getSystemValueBool('auth.bruteforce.protection.enabled', true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -151,7 +151,7 @@ class Throttler implements IThrottler {
|
|||
* @return bool
|
||||
*/
|
||||
private function isIPWhitelisted(string $ip): bool {
|
||||
if ($this->config->getSystemValue('auth.bruteforce.protection.enabled', true) === false) {
|
||||
if (!$this->config->getSystemValueBool('auth.bruteforce.protection.enabled', true)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ class CertificateManager implements ICertificateManager {
|
|||
* @return \OCP\ICertificate[]
|
||||
*/
|
||||
public function listCertificates(): array {
|
||||
if (!$this->config->getSystemValue('installed', false)) {
|
||||
if (!$this->config->getSystemValueBool('installed', false)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
@ -93,7 +93,7 @@ class CertificateManager implements ICertificateManager {
|
|||
}
|
||||
|
||||
private function hasCertificates(): bool {
|
||||
if (!$this->config->getSystemValue('installed', false)) {
|
||||
if (!$this->config->getSystemValueBool('installed', false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ class Crypto implements ICrypto {
|
|||
*/
|
||||
public function calculateHMAC(string $message, string $password = ''): string {
|
||||
if ($password === '') {
|
||||
$password = $this->config->getSystemValue('secret');
|
||||
$password = $this->config->getSystemValueString('secret');
|
||||
}
|
||||
|
||||
// Append an "a" behind the password and hash it to prevent reusing the same password as for encryption
|
||||
|
|
@ -92,7 +92,7 @@ class Crypto implements ICrypto {
|
|||
*/
|
||||
public function encrypt(string $plaintext, string $password = ''): string {
|
||||
if ($password === '') {
|
||||
$password = $this->config->getSystemValue('secret');
|
||||
$password = $this->config->getSystemValueString('secret');
|
||||
}
|
||||
$keyMaterial = hash_hkdf('sha512', $password);
|
||||
$this->cipher->setPassword(substr($keyMaterial, 0, 32));
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ class Hasher implements IHasher {
|
|||
}
|
||||
|
||||
// Check if we should use PASSWORD_DEFAULT
|
||||
if ($this->config->getSystemValue('hashing_default_password', false) === true) {
|
||||
if ($this->config->getSystemValueBool('hashing_default_password', false)) {
|
||||
$default = PASSWORD_DEFAULT;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ class VerificationToken implements IVerificationToken {
|
|||
}
|
||||
|
||||
try {
|
||||
$decryptedToken = $this->crypto->decrypt($encryptedToken, $passwordPrefix.$this->config->getSystemValue('secret'));
|
||||
$decryptedToken = $this->crypto->decrypt($encryptedToken, $passwordPrefix.$this->config->getSystemValueString('secret'));
|
||||
} catch (\Exception $e) {
|
||||
// Retry with empty secret as a fallback for instances where the secret might not have been set by accident
|
||||
try {
|
||||
|
|
@ -115,7 +115,7 @@ class VerificationToken implements IVerificationToken {
|
|||
ISecureRandom::CHAR_UPPER
|
||||
);
|
||||
$tokenValue = $this->timeFactory->getTime() .':'. $token;
|
||||
$encryptedValue = $this->crypto->encrypt($tokenValue, $passwordPrefix . $this->config->getSystemValue('secret'));
|
||||
$encryptedValue = $this->crypto->encrypt($tokenValue, $passwordPrefix . $this->config->getSystemValueString('secret'));
|
||||
$this->config->setUserValue($user->getUID(), 'core', $subject, $encryptedValue);
|
||||
$jobArgs = json_encode([
|
||||
'userId' => $user->getUID(),
|
||||
|
|
|
|||
|
|
@ -728,7 +728,7 @@ class Server extends ServerContainer implements IServerContainer {
|
|||
/** @var \OCP\IConfig $config */
|
||||
$config = $c->get(\OCP\IConfig::class);
|
||||
|
||||
if ($config->getSystemValue('installed', false) && !(defined('PHPUNIT_RUN') && PHPUNIT_RUN)) {
|
||||
if ($config->getSystemValueBool('installed', false) && !(defined('PHPUNIT_RUN') && PHPUNIT_RUN)) {
|
||||
if (!$config->getSystemValueBool('log_query')) {
|
||||
$v = \OC_App::getAppVersions();
|
||||
} else {
|
||||
|
|
@ -990,7 +990,7 @@ class Server extends ServerContainer implements IServerContainer {
|
|||
/** @deprecated 20.0.0 */
|
||||
$this->registerDeprecatedAlias('IniWrapper', IniGetWrapper::class);
|
||||
$this->registerService(IBus::class, function (ContainerInterface $c) {
|
||||
$busClass = $c->get(\OCP\IConfig::class)->getSystemValue('commandbus');
|
||||
$busClass = $c->get(\OCP\IConfig::class)->getSystemValueString('commandbus');
|
||||
if ($busClass) {
|
||||
[$app, $class] = explode('::', $busClass, 2);
|
||||
if ($c->get(IAppManager::class)->isInstalled($app)) {
|
||||
|
|
@ -1109,8 +1109,8 @@ class Server extends ServerContainer implements IServerContainer {
|
|||
$this->registerService(ILockingProvider::class, function (ContainerInterface $c) {
|
||||
$ini = $c->get(IniGetWrapper::class);
|
||||
$config = $c->get(\OCP\IConfig::class);
|
||||
$ttl = $config->getSystemValue('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time')));
|
||||
if ($config->getSystemValue('filelocking.enabled', true) or (defined('PHPUNIT_RUN') && PHPUNIT_RUN)) {
|
||||
$ttl = $config->getSystemValueInt('filelocking.ttl', max(3600, $ini->getNumeric('max_execution_time')));
|
||||
if ($config->getSystemValueBool('filelocking.enabled', true) or (defined('PHPUNIT_RUN') && PHPUNIT_RUN)) {
|
||||
/** @var \OC\Memcache\Factory $memcacheFactory */
|
||||
$memcacheFactory = $c->get(ICacheFactory::class);
|
||||
$memcache = $memcacheFactory->createLocking('lock');
|
||||
|
|
@ -1210,7 +1210,7 @@ class Server extends ServerContainer implements IServerContainer {
|
|||
$classExists = false;
|
||||
}
|
||||
|
||||
if ($classExists && $c->get(\OCP\IConfig::class)->getSystemValue('installed', false) && $c->get(IAppManager::class)->isInstalled('theming') && $c->getTrustedDomainHelper()->isTrustedDomain($c->getRequest()->getInsecureServerHost())) {
|
||||
if ($classExists && $c->get(\OCP\IConfig::class)->getSystemValueBool('installed', false) && $c->get(IAppManager::class)->isInstalled('theming') && $c->getTrustedDomainHelper()->isTrustedDomain($c->getRequest()->getInsecureServerHost())) {
|
||||
$imageManager = new ImageManager(
|
||||
$c->get(\OCP\IConfig::class),
|
||||
$c->getAppDataDir('theming'),
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ class Setup {
|
|||
|
||||
// create empty file in data dir, so we can later find
|
||||
// out that this is indeed an ownCloud data directory
|
||||
file_put_contents($config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/.ocdata', '');
|
||||
file_put_contents($config->getSystemValueString('datadirectory', \OC::$SERVERROOT . '/data') . '/.ocdata', '');
|
||||
|
||||
// Update .htaccess files
|
||||
self::updateHtaccess();
|
||||
|
|
@ -585,7 +585,7 @@ class Setup {
|
|||
$content .= " IndexIgnore *\n";
|
||||
$content .= "</IfModule>";
|
||||
|
||||
$baseDir = \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data');
|
||||
$baseDir = \OC::$server->getConfig()->getSystemValueString('datadirectory', \OC::$SERVERROOT . '/data');
|
||||
file_put_contents($baseDir . '/.htaccess', $content);
|
||||
file_put_contents($baseDir . '/index.html', '');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1179,7 +1179,7 @@ class Manager implements IManager {
|
|||
* Set the share's password expiration time
|
||||
*/
|
||||
private function setSharePasswordExpirationTime(IShare $share): void {
|
||||
if (!$this->config->getSystemValue('sharing.enable_mail_link_password_expiration', false)) {
|
||||
if (!$this->config->getSystemValueBool('sharing.enable_mail_link_password_expiration', false)) {
|
||||
// Sets password expiration date to NULL
|
||||
$share->setPasswordExpirationTime();
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -176,7 +176,7 @@ class Registry implements IRegistry {
|
|||
}
|
||||
|
||||
$userCount = $this->getUserCount();
|
||||
$hardUserLimit = $this->config->getSystemValue('one-click-instance.user-limit', 50);
|
||||
$hardUserLimit = $this->config->getSystemValueInt('one-click-instance.user-limit', 50);
|
||||
|
||||
$userLimitReached = $userCount >= $hardUserLimit;
|
||||
if ($userLimitReached && $notificationManager instanceof IManager) {
|
||||
|
|
|
|||
|
|
@ -221,7 +221,7 @@ class TemplateLayout extends \OC_Template {
|
|||
// TODO: remove deprecated OC_Util injection
|
||||
$jsFiles = self::findJavascriptFiles(array_merge(\OC_Util::$scripts, Util::getScripts()));
|
||||
$this->assign('jsfiles', []);
|
||||
if ($this->config->getSystemValue('installed', false) && $renderAs != TemplateResponse::RENDER_AS_ERROR) {
|
||||
if ($this->config->getSystemValueBool('installed', false) && $renderAs != TemplateResponse::RENDER_AS_ERROR) {
|
||||
// this is on purpose outside of the if statement below so that the initial state is prefilled (done in the getConfig() call)
|
||||
// see https://github.com/nextcloud/server/pull/22636 for details
|
||||
$jsConfigHelper = new JSConfigHelper(
|
||||
|
|
@ -304,14 +304,14 @@ class TemplateLayout extends \OC_Template {
|
|||
* @return string
|
||||
*/
|
||||
protected function getVersionHashSuffix($path = false, $file = false) {
|
||||
if ($this->config->getSystemValue('debug', false)) {
|
||||
if ($this->config->getSystemValueBool('debug', false)) {
|
||||
// allows chrome workspace mapping in debug mode
|
||||
return "";
|
||||
}
|
||||
$themingSuffix = '';
|
||||
$v = [];
|
||||
|
||||
if ($this->config->getSystemValue('installed', false)) {
|
||||
if ($this->config->getSystemValueBool('installed', false)) {
|
||||
if (\OC::$server->getAppManager()->isInstalled('theming')) {
|
||||
$themingSuffix = '-' . $this->config->getAppValue('theming', 'cachebuster', '0');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ class URLGenerator implements IURLGenerator {
|
|||
* Returns a url to the given app and file.
|
||||
*/
|
||||
public function linkTo(string $appName, string $file, array $args = []): string {
|
||||
$frontControllerActive = ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true');
|
||||
$frontControllerActive = ($this->config->getSystemValueBool('htaccess.IgnoreFrontController', false) || getenv('front_controller_active') === 'true');
|
||||
|
||||
if ($appName !== '') {
|
||||
$app_path = $this->getAppManager()->getAppPath($appName);
|
||||
|
|
@ -214,7 +214,7 @@ class URLGenerator implements IURLGenerator {
|
|||
|
||||
// Check if the app is in the app folder
|
||||
$path = '';
|
||||
$themingEnabled = $this->config->getSystemValue('installed', false) && $this->getAppManager()->isEnabledForUser('theming');
|
||||
$themingEnabled = $this->config->getSystemValueBool('installed', false) && $this->getAppManager()->isEnabledForUser('theming');
|
||||
$themingImagePath = false;
|
||||
if ($themingEnabled) {
|
||||
$themingDefaults = \OC::$server->getThemingDefaults();
|
||||
|
|
@ -275,7 +275,7 @@ class URLGenerator implements IURLGenerator {
|
|||
$separator = strpos($url, '/') === 0 ? '' : '/';
|
||||
|
||||
if (\OC::$CLI && !\defined('PHPUNIT_RUN')) {
|
||||
return rtrim($this->config->getSystemValue('overwrite.cli.url'), '/') . '/' . ltrim($url, '/');
|
||||
return rtrim($this->config->getSystemValueString('overwrite.cli.url'), '/') . '/' . ltrim($url, '/');
|
||||
}
|
||||
// The ownCloud web root can already be prepended.
|
||||
if (\OC::$WEBROOT !== '' && strpos($url, \OC::$WEBROOT) === 0) {
|
||||
|
|
@ -313,7 +313,7 @@ class URLGenerator implements IURLGenerator {
|
|||
|
||||
$appId = $this->getAppManager()->getDefaultAppForUser();
|
||||
|
||||
if ($this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true
|
||||
if ($this->config->getSystemValueBool('htaccess.IgnoreFrontController', false)
|
||||
|| getenv('front_controller_active') === 'true') {
|
||||
return $this->getAbsoluteURL('/apps/' . $appId . '/');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ class Updater extends BasicEmitter {
|
|||
}
|
||||
}
|
||||
|
||||
$installedVersion = $this->config->getSystemValue('version', '0.0.0');
|
||||
$installedVersion = $this->config->getSystemValueString('version', '0.0.0');
|
||||
$currentVersion = implode('.', \OCP\Util::getVersion());
|
||||
|
||||
$this->log->debug('starting upgrade from ' . $installedVersion . ' to ' . $currentVersion, ['app' => 'core']);
|
||||
|
|
@ -216,7 +216,7 @@ class Updater extends BasicEmitter {
|
|||
if ($currentVendor === 'nextcloud') {
|
||||
return isset($allowedPreviousVersions[$currentVendor][$majorMinor])
|
||||
&& (version_compare($oldVersion, $newVersion, '<=') ||
|
||||
$this->config->getSystemValue('debug', false));
|
||||
$this->config->getSystemValueBool('debug', false));
|
||||
}
|
||||
|
||||
// Check if the instance can be migrated
|
||||
|
|
@ -251,7 +251,7 @@ class Updater extends BasicEmitter {
|
|||
// create empty file in data dir, so we can later find
|
||||
// out that this is indeed an ownCloud data directory
|
||||
// (in case it didn't exist before)
|
||||
file_put_contents($this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/.ocdata', '');
|
||||
file_put_contents($this->config->getSystemValueString('datadirectory', \OC::$SERVERROOT . '/data') . '/.ocdata', '');
|
||||
|
||||
// pre-upgrade repairs
|
||||
$repair = new Repair(Repair::getBeforeUpgradeRepairSteps(), \OC::$server->get(\OCP\EventDispatcher\IEventDispatcher::class), \OC::$server->get(LoggerInterface::class));
|
||||
|
|
@ -399,7 +399,7 @@ class Updater extends BasicEmitter {
|
|||
* @return bool
|
||||
*/
|
||||
private function isCodeUpgrade(): bool {
|
||||
$installedVersion = $this->config->getSystemValue('version', '0.0.0');
|
||||
$installedVersion = $this->config->getSystemValueString('version', '0.0.0');
|
||||
$currentVersion = implode('.', Util::getVersion());
|
||||
if (version_compare($currentVersion, $installedVersion, '>')) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ class VersionCheck {
|
|||
return json_decode($this->config->getAppValue('core', 'lastupdateResult'), true);
|
||||
}
|
||||
|
||||
$updaterUrl = $this->config->getSystemValue('updater.server.url', 'https://updates.nextcloud.com/updater_server/');
|
||||
$updaterUrl = $this->config->getSystemValueString('updater.server.url', 'https://updates.nextcloud.com/updater_server/');
|
||||
|
||||
$this->config->setAppValue('core', 'lastupdatedat', (string)time());
|
||||
|
||||
|
|
|
|||
|
|
@ -447,7 +447,7 @@ class Database extends ABackend implements
|
|||
*/
|
||||
public function getHome(string $uid) {
|
||||
if ($this->userExists($uid)) {
|
||||
return \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/' . $uid;
|
||||
return \OC::$server->getConfig()->getSystemValueString('datadirectory', \OC::$SERVERROOT . '/data') . '/' . $uid;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -491,8 +491,8 @@ class Session implements IUserSession, Emitter {
|
|||
return false;
|
||||
}
|
||||
|
||||
private function isTokenAuthEnforced() {
|
||||
return $this->config->getSystemValue('token_auth_enforced', false);
|
||||
private function isTokenAuthEnforced(): bool {
|
||||
return $this->config->getSystemValueBool('token_auth_enforced', false);
|
||||
}
|
||||
|
||||
protected function isTwoFactorEnforced($username) {
|
||||
|
|
@ -958,7 +958,7 @@ class Session implements IUserSession, Emitter {
|
|||
$webRoot = '/';
|
||||
}
|
||||
|
||||
$maxAge = $this->config->getSystemValue('remember_login_cookie_lifetime', 60 * 60 * 24 * 15);
|
||||
$maxAge = $this->config->getSystemValueInt('remember_login_cookie_lifetime', 60 * 60 * 24 * 15);
|
||||
\OC\Http\CookieHelper::setCookie(
|
||||
'nc_username',
|
||||
$username,
|
||||
|
|
|
|||
|
|
@ -363,7 +363,7 @@ class User implements IUser {
|
|||
if (($this->backend instanceof IGetHomeBackend || $this->backend->implementsActions(Backend::GET_HOME)) && $home = $this->backend->getHome($this->uid)) {
|
||||
$this->home = $home;
|
||||
} elseif ($this->config) {
|
||||
$this->home = $this->config->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data') . '/' . $this->uid;
|
||||
$this->home = $this->config->getSystemValueString('datadirectory', \OC::$SERVERROOT . '/data') . '/' . $this->uid;
|
||||
} else {
|
||||
$this->home = \OC::$SERVERROOT . '/data/' . $this->uid;
|
||||
}
|
||||
|
|
@ -416,7 +416,7 @@ class User implements IUser {
|
|||
* @return bool
|
||||
*/
|
||||
public function canChangeDisplayName() {
|
||||
if ($this->config->getSystemValue('allow_user_to_change_display_name') === false) {
|
||||
if (!$this->config->getSystemValueBool('allow_user_to_change_display_name')) {
|
||||
return false;
|
||||
}
|
||||
return $this->backend->implementsActions(Backend::SET_DISPLAYNAME);
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class OC_FileChunking {
|
|||
*/
|
||||
public function __construct($info) {
|
||||
$this->info = $info;
|
||||
$this->ttl = \OC::$server->getConfig()->getSystemValue('cache_chunk_gc_ttl', 86400);
|
||||
$this->ttl = \OC::$server->getConfig()->getSystemValueInt('cache_chunk_gc_ttl', 86400);
|
||||
}
|
||||
|
||||
public function getPrefix() {
|
||||
|
|
|
|||
|
|
@ -634,6 +634,6 @@ class OC_Helper {
|
|||
* @return bool
|
||||
*/
|
||||
public static function isReadOnlyConfigEnabled() {
|
||||
return \OC::$server->getConfig()->getSystemValue('config_is_read_only', false);
|
||||
return \OC::$server->getConfig()->getSystemValueBool('config_is_read_only', false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -185,7 +185,7 @@ class OC_Util {
|
|||
/** @var LoggerInterface $logger */
|
||||
$logger = \OC::$server->get(LoggerInterface::class);
|
||||
|
||||
$plainSkeletonDirectory = \OC::$server->getConfig()->getSystemValue('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton');
|
||||
$plainSkeletonDirectory = \OC::$server->getConfig()->getSystemValueString('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton');
|
||||
$userLang = \OC::$server->getL10NFactory()->findLanguage();
|
||||
$skeletonDirectory = str_replace('{lang}', $userLang, $plainSkeletonDirectory);
|
||||
|
||||
|
|
@ -306,7 +306,7 @@ class OC_Util {
|
|||
*/
|
||||
public static function getChannel() {
|
||||
OC_Util::loadVersion();
|
||||
return \OC::$server->getConfig()->getSystemValue('updater.release.channel', self::$versionCache['OC_Channel']);
|
||||
return \OC::$server->getConfig()->getSystemValueString('updater.release.channel', self::$versionCache['OC_Channel']);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -783,7 +783,7 @@ class OC_Util {
|
|||
* @return array arrays with error messages and hints
|
||||
*/
|
||||
public static function checkDataDirectoryPermissions($dataDirectory) {
|
||||
if (\OC::$server->getConfig()->getSystemValue('check_data_directory_permissions', true) === false) {
|
||||
if (!\OC::$server->getConfig()->getSystemValueBool('check_data_directory_permissions', true)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
|
|
@ -957,7 +957,7 @@ class OC_Util {
|
|||
$testContent = 'This is used for testing whether htaccess is properly enabled to disallow access from the outside. This file can be safely removed.';
|
||||
|
||||
// creating a test file
|
||||
$testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT . '/data') . '/' . $fileName;
|
||||
$testFile = $config->getSystemValueString('datadirectory', OC::$SERVERROOT . '/data') . '/' . $fileName;
|
||||
|
||||
if (file_exists($testFile)) {// already running this test, possible recursive call
|
||||
return false;
|
||||
|
|
@ -983,7 +983,7 @@ class OC_Util {
|
|||
* @throws \OCP\HintException If the test file can't get written.
|
||||
*/
|
||||
public function isHtaccessWorking(\OCP\IConfig $config) {
|
||||
if (\OC::$CLI || !$config->getSystemValue('check_for_working_htaccess', true)) {
|
||||
if (\OC::$CLI || !$config->getSystemValueBool('check_for_working_htaccess', true)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -993,7 +993,7 @@ class OC_Util {
|
|||
}
|
||||
|
||||
$fileName = '/htaccesstest.txt';
|
||||
$testFile = $config->getSystemValue('datadirectory', OC::$SERVERROOT . '/data') . '/' . $fileName;
|
||||
$testFile = $config->getSystemValueString('datadirectory', OC::$SERVERROOT . '/data') . '/' . $fileName;
|
||||
|
||||
// accessing the file via http
|
||||
$url = \OC::$server->getURLGenerator()->getAbsoluteURL(OC::$WEBROOT . '/data' . $fileName);
|
||||
|
|
|
|||
|
|
@ -109,7 +109,7 @@ class UpdateLanguageCodesTest extends TestCase {
|
|||
);
|
||||
|
||||
$this->config->expects($this->once())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->with('version', '0.0.0')
|
||||
->willReturn('12.0.0.13');
|
||||
|
||||
|
|
@ -155,7 +155,7 @@ class UpdateLanguageCodesTest extends TestCase {
|
|||
->method('info');
|
||||
|
||||
$this->config->expects($this->once())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->with('version', '0.0.0')
|
||||
->willReturn('12.0.0.14');
|
||||
|
||||
|
|
|
|||
|
|
@ -1872,7 +1872,7 @@ EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
|
|||
}
|
||||
|
||||
public function testGetWithFilter() {
|
||||
$this->config->method('getSystemValue')
|
||||
$this->config->method('getSystemValueString')
|
||||
->willReturnCallback(function ($key, $default) {
|
||||
if ($key === 'version') {
|
||||
return '11.0.0.2';
|
||||
|
|
@ -1884,8 +1884,7 @@ EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
|
|||
});
|
||||
$this->config
|
||||
->method('getSystemValueBool')
|
||||
->with('appstoreenabled', true)
|
||||
->willReturn(true);
|
||||
->willReturnArgument(1);
|
||||
|
||||
$file = $this->createMock(ISimpleFile::class);
|
||||
$folder = $this->createMock(ISimpleFolder::class);
|
||||
|
|
@ -1957,7 +1956,7 @@ EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
|
|||
|
||||
public function testAppstoreDisabled() {
|
||||
$this->config
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->willReturnCallback(function ($var, $default) {
|
||||
if ($var === 'version') {
|
||||
return '11.0.0.2';
|
||||
|
|
@ -1966,8 +1965,14 @@ EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
|
|||
});
|
||||
$this->config
|
||||
->method('getSystemValueBool')
|
||||
->with('appstoreenabled', true)
|
||||
->willReturn(false);
|
||||
->willReturnCallback(function ($var, $default) {
|
||||
if ($var === 'has_internet_connection') {
|
||||
return true;
|
||||
} elseif ($var === 'appstoreenabled') {
|
||||
return false;
|
||||
}
|
||||
return $default;
|
||||
});
|
||||
$this->appData
|
||||
->expects($this->never())
|
||||
->method('getFolder');
|
||||
|
|
@ -1978,7 +1983,7 @@ EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
|
|||
|
||||
public function testNoInternet() {
|
||||
$this->config
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->willReturnCallback(function ($var, $default) {
|
||||
if ($var === 'has_internet_connection') {
|
||||
return false;
|
||||
|
|
@ -1989,8 +1994,14 @@ EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
|
|||
});
|
||||
$this->config
|
||||
->method('getSystemValueBool')
|
||||
->with('appstoreenabled', true)
|
||||
->willReturn(true);
|
||||
->willReturnCallback(function ($var, $default) {
|
||||
if ($var === 'has_internet_connection') {
|
||||
return false;
|
||||
} elseif ($var === 'appstoreenabled') {
|
||||
return true;
|
||||
}
|
||||
return $default;
|
||||
});
|
||||
$this->appData
|
||||
->expects($this->never())
|
||||
->method('getFolder');
|
||||
|
|
@ -1999,7 +2010,7 @@ EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
|
|||
}
|
||||
|
||||
public function testSetVersion() {
|
||||
$this->config->method('getSystemValue')
|
||||
$this->config->method('getSystemValueString')
|
||||
->willReturnCallback(function ($key, $default) {
|
||||
if ($key === 'version') {
|
||||
return '10.0.7.2';
|
||||
|
|
@ -2011,8 +2022,7 @@ EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
|
|||
});
|
||||
$this->config
|
||||
->method('getSystemValueBool')
|
||||
->with('appstoreenabled', true)
|
||||
->willReturn(true);
|
||||
->willReturnArgument(1);
|
||||
|
||||
$file = $this->createMock(ISimpleFile::class);
|
||||
$folder = $this->createMock(ISimpleFolder::class);
|
||||
|
|
@ -2084,13 +2094,19 @@ EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
|
|||
}
|
||||
|
||||
public function testGetAppsAllowlist() {
|
||||
$this->config->method('getSystemValue')
|
||||
$this->config->method('getSystemValueString')
|
||||
->willReturnCallback(function ($key, $default) {
|
||||
if ($key === 'version') {
|
||||
return '11.0.0.2';
|
||||
} elseif ($key === 'appstoreurl' && $default === 'https://apps.nextcloud.com/api/v1') {
|
||||
return 'https://custom.appsstore.endpoint/api/v1';
|
||||
} elseif ($key === 'appsallowlist') {
|
||||
} else {
|
||||
return $default;
|
||||
}
|
||||
});
|
||||
$this->config->method('getSystemValue')
|
||||
->willReturnCallback(function ($key, $default) {
|
||||
if ($key === 'appsallowlist') {
|
||||
return ['contacts'];
|
||||
} else {
|
||||
return $default;
|
||||
|
|
@ -2098,8 +2114,7 @@ EJL3BaQAQaASSsvFrcozYxrQG4VzEg==
|
|||
});
|
||||
$this->config
|
||||
->method('getSystemValueBool')
|
||||
->with('appstoreenabled', true)
|
||||
->willReturn(true);
|
||||
->willReturnArgument(1);
|
||||
|
||||
$file = $this->createMock(ISimpleFile::class);
|
||||
$folder = $this->createMock(ISimpleFolder::class);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class CategoryFetcherTest extends FetcherBase {
|
|||
|
||||
public function testAppstoreDisabled() {
|
||||
$this->config
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->willReturnCallback(function ($var, $default) {
|
||||
if ($var === 'appstoreenabled') {
|
||||
return false;
|
||||
|
|
@ -57,7 +57,7 @@ class CategoryFetcherTest extends FetcherBase {
|
|||
|
||||
public function testNoInternet() {
|
||||
$this->config
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->willReturnCallback(function ($var, $default) {
|
||||
if ($var === 'has_internet_connection') {
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -76,20 +76,12 @@ abstract class FetcherBase extends TestCase {
|
|||
|
||||
public function testGetWithAlreadyExistingFileAndUpToDateTimestampAndVersion() {
|
||||
$this->config
|
||||
->expects($this->once())
|
||||
->method('getSystemValueBool')
|
||||
->with('appstoreenabled', true)
|
||||
->willReturn(true);
|
||||
$this->config
|
||||
->expects($this->exactly(2))
|
||||
->method('getSystemValue')
|
||||
->withConsecutive(
|
||||
['has_internet_connection', true],
|
||||
[$this->equalTo('version'), $this->anything()],
|
||||
)->willReturnOnConsecutiveCalls(
|
||||
true,
|
||||
'11.0.0.2',
|
||||
);
|
||||
->expects($this->exactly(1))
|
||||
->method('getSystemValueString')
|
||||
->with($this->equalTo('version'), $this->anything())
|
||||
->willReturn('11.0.0.2');
|
||||
$this->config->method('getSystemValueBool')
|
||||
->willReturnArgument(1);
|
||||
|
||||
$folder = $this->createMock(ISimpleFolder::class);
|
||||
$file = $this->createMock(ISimpleFile::class);
|
||||
|
|
@ -122,21 +114,17 @@ abstract class FetcherBase extends TestCase {
|
|||
|
||||
public function testGetWithNotExistingFileAndUpToDateTimestampAndVersion() {
|
||||
$this->config
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->willReturnCallback(function ($var, $default) {
|
||||
if ($var === 'has_internet_connection') {
|
||||
return true;
|
||||
} elseif ($var === 'appstoreurl') {
|
||||
if ($var === 'appstoreurl') {
|
||||
return 'https://apps.nextcloud.com/api/v1';
|
||||
} elseif ($var === 'version') {
|
||||
return '11.0.0.2';
|
||||
}
|
||||
return $default;
|
||||
});
|
||||
$this->config
|
||||
->method('getSystemValueBool')
|
||||
->with('appstoreenabled', $this->anything())
|
||||
->willReturn(true);
|
||||
$this->config->method('getSystemValueBool')
|
||||
->willReturnArgument(1);
|
||||
|
||||
$folder = $this->createMock(ISimpleFolder::class);
|
||||
$file = $this->createMock(ISimpleFile::class);
|
||||
|
|
@ -200,7 +188,7 @@ abstract class FetcherBase extends TestCase {
|
|||
}
|
||||
|
||||
public function testGetWithAlreadyExistingFileAndOutdatedTimestamp() {
|
||||
$this->config->method('getSystemValue')
|
||||
$this->config->method('getSystemValueString')
|
||||
->willReturnCallback(function ($key, $default) {
|
||||
if ($key === 'version') {
|
||||
return '11.0.0.2';
|
||||
|
|
@ -208,10 +196,8 @@ abstract class FetcherBase extends TestCase {
|
|||
return $default;
|
||||
}
|
||||
});
|
||||
$this->config
|
||||
->method('getSystemValueBool')
|
||||
->with('appstoreenabled', true)
|
||||
->willReturn(true);
|
||||
$this->config->method('getSystemValueBool')
|
||||
->willReturnArgument(1);
|
||||
|
||||
$folder = $this->createMock(ISimpleFolder::class);
|
||||
$file = $this->createMock(ISimpleFile::class);
|
||||
|
|
@ -277,21 +263,17 @@ abstract class FetcherBase extends TestCase {
|
|||
|
||||
public function testGetWithAlreadyExistingFileAndNoVersion() {
|
||||
$this->config
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->willReturnCallback(function ($var, $default) {
|
||||
if ($var === 'has_internet_connection') {
|
||||
return true;
|
||||
} elseif ($var === 'appstoreurl') {
|
||||
if ($var === 'appstoreurl') {
|
||||
return 'https://apps.nextcloud.com/api/v1';
|
||||
} elseif ($var === 'version') {
|
||||
return '11.0.0.2';
|
||||
}
|
||||
return $default;
|
||||
});
|
||||
$this->config
|
||||
->method('getSystemValueBool')
|
||||
->with('appstoreenabled', true)
|
||||
->willReturn(true);
|
||||
$this->config->method('getSystemValueBool')
|
||||
->willReturnArgument(1);
|
||||
|
||||
$folder = $this->createMock(ISimpleFolder::class);
|
||||
$file = $this->createMock(ISimpleFile::class);
|
||||
|
|
@ -354,21 +336,17 @@ abstract class FetcherBase extends TestCase {
|
|||
|
||||
public function testGetWithAlreadyExistingFileAndOutdatedVersion() {
|
||||
$this->config
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->willReturnCallback(function ($var, $default) {
|
||||
if ($var === 'has_internet_connection') {
|
||||
return true;
|
||||
} elseif ($var === 'appstoreurl') {
|
||||
if ($var === 'appstoreurl') {
|
||||
return 'https://apps.nextcloud.com/api/v1';
|
||||
} elseif ($var === 'version') {
|
||||
return '11.0.0.2';
|
||||
}
|
||||
return $default;
|
||||
});
|
||||
$this->config
|
||||
->method('getSystemValueBool')
|
||||
->with('appstoreenabled', true)
|
||||
->willReturn(true);
|
||||
$this->config->method('getSystemValueBool')
|
||||
->willReturnArgument(1);
|
||||
|
||||
$folder = $this->createMock(ISimpleFolder::class);
|
||||
$file = $this->createMock(ISimpleFile::class);
|
||||
|
|
@ -429,14 +407,10 @@ abstract class FetcherBase extends TestCase {
|
|||
}
|
||||
|
||||
public function testGetWithExceptionInClient() {
|
||||
$this->config->method('getSystemValue')
|
||||
->willReturnCallback(function ($key, $default) {
|
||||
return $default;
|
||||
});
|
||||
$this->config
|
||||
->method('getSystemValueBool')
|
||||
->with('appstoreenabled', true)
|
||||
->willReturn(true);
|
||||
$this->config->method('getSystemValueString')
|
||||
->willReturnArgument(1);
|
||||
$this->config->method('getSystemValueBool')
|
||||
->willReturnArgument(1);
|
||||
|
||||
$folder = $this->createMock(ISimpleFolder::class);
|
||||
$file = $this->createMock(ISimpleFile::class);
|
||||
|
|
@ -469,7 +443,7 @@ abstract class FetcherBase extends TestCase {
|
|||
}
|
||||
|
||||
public function testGetMatchingETag() {
|
||||
$this->config->method('getSystemValue')
|
||||
$this->config->method('getSystemValueString')
|
||||
->willReturnCallback(function ($key, $default) {
|
||||
if ($key === 'version') {
|
||||
return '11.0.0.2';
|
||||
|
|
@ -477,10 +451,8 @@ abstract class FetcherBase extends TestCase {
|
|||
return $default;
|
||||
}
|
||||
});
|
||||
$this->config
|
||||
->method('getSystemValueBool')
|
||||
->with('appstoreenabled', true)
|
||||
->willReturn(true);
|
||||
$this->config->method('getSystemValueBool')
|
||||
->willReturnArgument(1);
|
||||
|
||||
$folder = $this->createMock(ISimpleFolder::class);
|
||||
$file = $this->createMock(ISimpleFile::class);
|
||||
|
|
@ -550,7 +522,7 @@ abstract class FetcherBase extends TestCase {
|
|||
}
|
||||
|
||||
public function testGetNoMatchingETag() {
|
||||
$this->config->method('getSystemValue')
|
||||
$this->config->method('getSystemValueString')
|
||||
->willReturnCallback(function ($key, $default) {
|
||||
if ($key === 'version') {
|
||||
return '11.0.0.2';
|
||||
|
|
@ -558,10 +530,8 @@ abstract class FetcherBase extends TestCase {
|
|||
return $default;
|
||||
}
|
||||
});
|
||||
$this->config
|
||||
->method('getSystemValueBool')
|
||||
->with('appstoreenabled', true)
|
||||
->willReturn(true);
|
||||
$this->config->method('getSystemValueBool')
|
||||
->willReturnArgument(1);
|
||||
|
||||
$folder = $this->createMock(ISimpleFolder::class);
|
||||
$file = $this->createMock(ISimpleFile::class);
|
||||
|
|
@ -637,7 +607,7 @@ abstract class FetcherBase extends TestCase {
|
|||
|
||||
|
||||
public function testFetchAfterUpgradeNoETag() {
|
||||
$this->config->method('getSystemValue')
|
||||
$this->config->method('getSystemValueString')
|
||||
->willReturnCallback(function ($key, $default) {
|
||||
if ($key === 'version') {
|
||||
return '11.0.0.3';
|
||||
|
|
@ -645,10 +615,8 @@ abstract class FetcherBase extends TestCase {
|
|||
return $default;
|
||||
}
|
||||
});
|
||||
$this->config
|
||||
->method('getSystemValueBool')
|
||||
->with('appstoreenabled', true)
|
||||
->willReturn(true);
|
||||
$this->config->method('getSystemValueBool')
|
||||
->willReturnArgument(1);
|
||||
|
||||
$folder = $this->createMock(ISimpleFolder::class);
|
||||
$file = $this->createMock(ISimpleFile::class);
|
||||
|
|
|
|||
|
|
@ -938,7 +938,7 @@ class RequestTest extends \Test\TestCase {
|
|||
public function testGetServerProtocolWithOverride() {
|
||||
$this->config
|
||||
->expects($this->exactly(3))
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->willReturnMap([
|
||||
['overwriteprotocol', '', 'customProtocol'],
|
||||
['overwritecondaddr', '', ''],
|
||||
|
|
@ -1358,7 +1358,7 @@ class RequestTest extends \Test\TestCase {
|
|||
|
||||
public function testGetServerHostWithOverwriteHost() {
|
||||
$this->config
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->willReturnCallback(function ($key, $default) {
|
||||
if ($key === 'overwritecondaddr') {
|
||||
return '';
|
||||
|
|
@ -1513,7 +1513,7 @@ class RequestTest extends \Test\TestCase {
|
|||
public function testGetOverwriteHostDefaultNull() {
|
||||
$this->config
|
||||
->expects($this->once())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->with('overwritehost')
|
||||
->willReturn('');
|
||||
$request = new Request(
|
||||
|
|
@ -1530,7 +1530,7 @@ class RequestTest extends \Test\TestCase {
|
|||
public function testGetOverwriteHostWithOverwrite() {
|
||||
$this->config
|
||||
->expects($this->exactly(3))
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->willReturnMap([
|
||||
['overwritehost', '', 'www.owncloud.org'],
|
||||
['overwritecondaddr', '', ''],
|
||||
|
|
@ -1717,7 +1717,7 @@ class RequestTest extends \Test\TestCase {
|
|||
public function testGetRequestUriWithoutOverwrite() {
|
||||
$this->config
|
||||
->expects($this->once())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->with('overwritewebroot')
|
||||
->willReturn('');
|
||||
|
||||
|
|
@ -1749,7 +1749,7 @@ class RequestTest extends \Test\TestCase {
|
|||
public function testGetRequestUriWithOverwrite($expectedUri, $overwriteWebRoot, $overwriteCondAddr) {
|
||||
$this->config
|
||||
->expects($this->exactly(2))
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->willReturnMap([
|
||||
['overwritewebroot', '', $overwriteWebRoot],
|
||||
['overwritecondaddr', '', $overwriteCondAddr],
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ class FinishRememberedLoginCommandTest extends ALoginCommandTest {
|
|||
public function testProcess() {
|
||||
$data = $this->getLoggedInLoginData();
|
||||
$this->config->expects($this->once())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('auto_logout', false)
|
||||
->willReturn(false);
|
||||
$this->userSession->expects($this->once())
|
||||
|
|
@ -77,7 +77,7 @@ class FinishRememberedLoginCommandTest extends ALoginCommandTest {
|
|||
public function testProcessNotRemeberedLoginWithAutologout() {
|
||||
$data = $this->getLoggedInLoginData();
|
||||
$this->config->expects($this->once())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('auto_logout', false)
|
||||
->willReturn(true);
|
||||
$this->userSession->expects($this->never())
|
||||
|
|
|
|||
|
|
@ -67,13 +67,20 @@ class PublicKeyTokenProviderTest extends TestCase {
|
|||
$this->hasher = \OC::$server->getHasher();
|
||||
$this->crypto = \OC::$server->getCrypto();
|
||||
$this->config = $this->createMock(IConfig::class);
|
||||
$this->config->method('getSystemValue')
|
||||
$this->config->method('getSystemValueInt')
|
||||
->willReturnMap([
|
||||
['session_lifetime', 60 * 60 * 24, 150],
|
||||
['remember_login_cookie_lifetime', 60 * 60 * 24 * 15, 300],
|
||||
['secret', '', '1f4h9s'],
|
||||
['token_auth_activity_update', 60, 60],
|
||||
]);
|
||||
$this->config->method('getSystemValue')
|
||||
->willReturnMap([
|
||||
['openssl', [], []],
|
||||
]);
|
||||
$this->config->method('getSystemValueString')
|
||||
->willReturnMap([
|
||||
['secret', '', '1f4h9s'],
|
||||
]);
|
||||
$this->db = $this->createMock(IDBConnection::class);
|
||||
$this->logger = $this->createMock(LoggerInterface::class);
|
||||
$this->timeFactory = $this->createMock(ITimeFactory::class);
|
||||
|
|
@ -336,7 +343,7 @@ class PublicKeyTokenProviderTest extends TestCase {
|
|||
$defaultSessionLifetime = 60 * 60 * 24;
|
||||
$defaultRememberMeLifetime = 60 * 60 * 24 * 15;
|
||||
$this->config->expects($this->exactly(2))
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueInt')
|
||||
->willReturnMap([
|
||||
['session_lifetime', $defaultSessionLifetime, 150],
|
||||
['remember_login_cookie_lifetime', $defaultRememberMeLifetime, 300],
|
||||
|
|
|
|||
|
|
@ -92,19 +92,19 @@ class LookupPluginTest extends TestCase {
|
|||
->with('files_sharing', 'lookupServerEnabled', 'yes')
|
||||
->willReturn('yes');
|
||||
$this->config->expects($this->exactly(2))
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->withConsecutive(
|
||||
['gs.enabled', false],
|
||||
['lookup_server', 'https://lookup.nextcloud.com'],
|
||||
['has_internet_connection', true],
|
||||
)->willReturnOnConsecutiveCalls(
|
||||
false,
|
||||
'',
|
||||
true,
|
||||
);
|
||||
|
||||
$this->config->expects($this->once())
|
||||
->method('getSystemValueBool')
|
||||
->with('has_internet_connection', true)
|
||||
->willReturn(true);
|
||||
->method('getSystemValueString')
|
||||
->with('lookup_server', 'https://lookup.nextcloud.com')
|
||||
->willReturn('');
|
||||
|
||||
$this->clientService->expects($this->never())
|
||||
->method('newClient');
|
||||
|
|
@ -120,15 +120,15 @@ class LookupPluginTest extends TestCase {
|
|||
->method('getAppValue')
|
||||
->with('files_sharing', 'lookupServerEnabled', 'yes')
|
||||
->willReturn('yes');
|
||||
$this->config->expects($this->once())
|
||||
->method('getSystemValue')
|
||||
->with('gs.enabled', false)
|
||||
->willReturn(false);
|
||||
|
||||
$this->config->expects($this->once())
|
||||
$this->config->expects($this->exactly(2))
|
||||
->method('getSystemValueBool')
|
||||
->with('has_internet_connection', true)
|
||||
->willReturn(false);
|
||||
->withConsecutive(
|
||||
['gs.enabled', false],
|
||||
['has_internet_connection', true],
|
||||
)->willReturnOnConsecutiveCalls(
|
||||
false,
|
||||
false,
|
||||
);
|
||||
|
||||
$this->clientService->expects($this->never())
|
||||
->method('newClient');
|
||||
|
|
@ -157,19 +157,19 @@ class LookupPluginTest extends TestCase {
|
|||
->with('files_sharing', 'lookupServerEnabled', 'yes')
|
||||
->willReturn('yes');
|
||||
$this->config->expects($this->exactly(2))
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->withConsecutive(
|
||||
['gs.enabled', false],
|
||||
['lookup_server', 'https://lookup.nextcloud.com'],
|
||||
['has_internet_connection', true],
|
||||
)->willReturnOnConsecutiveCalls(
|
||||
false,
|
||||
$searchParams['server'],
|
||||
true,
|
||||
);
|
||||
|
||||
$this->config->expects($this->once())
|
||||
->method('getSystemValueBool')
|
||||
->with('has_internet_connection', true)
|
||||
->willReturn(true);
|
||||
->method('getSystemValueString')
|
||||
->with('lookup_server', 'https://lookup.nextcloud.com')
|
||||
->willReturn($searchParams['server']);
|
||||
|
||||
$response = $this->createMock(IResponse::class);
|
||||
$response->expects($this->once())
|
||||
|
|
@ -221,19 +221,19 @@ class LookupPluginTest extends TestCase {
|
|||
->method('addResultSet')
|
||||
->with($type, $searchParams['expectedResult'], []);
|
||||
|
||||
$this->config->expects($this->once())
|
||||
->method('getSystemValueBool')
|
||||
->with('has_internet_connection', true)
|
||||
->willReturn(true);
|
||||
$this->config->expects($this->exactly(2))
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->withConsecutive(
|
||||
['gs.enabled', false],
|
||||
['lookup_server', 'https://lookup.nextcloud.com'],
|
||||
['has_internet_connection', true],
|
||||
)->willReturnOnConsecutiveCalls(
|
||||
$GSEnabled,
|
||||
$searchParams['server'],
|
||||
true,
|
||||
);
|
||||
$this->config->expects($this->once())
|
||||
->method('getSystemValueString')
|
||||
->with('lookup_server', 'https://lookup.nextcloud.com')
|
||||
->willReturn($searchParams['server']);
|
||||
|
||||
$response = $this->createMock(IResponse::class);
|
||||
$response->expects($this->once())
|
||||
|
|
@ -254,10 +254,15 @@ class LookupPluginTest extends TestCase {
|
|||
->willReturn($client);
|
||||
} else {
|
||||
$searchResult->expects($this->never())->method('addResultSet');
|
||||
$this->config->expects($this->once())
|
||||
->method('getSystemValue')
|
||||
->with('gs.enabled', false)
|
||||
->willReturn($GSEnabled);
|
||||
$this->config->expects($this->exactly(2))
|
||||
->method('getSystemValueBool')
|
||||
->withConsecutive(
|
||||
['gs.enabled', false],
|
||||
['has_internet_connection', true],
|
||||
)->willReturnOnConsecutiveCalls(
|
||||
$GSEnabled,
|
||||
true,
|
||||
);
|
||||
}
|
||||
$moreResults = $this->plugin->search(
|
||||
$searchParams['search'],
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class MigratorTest extends \Test\TestCase {
|
|||
}
|
||||
|
||||
private function getUniqueTableName() {
|
||||
return strtolower($this->getUniqueID($this->config->getSystemValue('dbtableprefix', 'oc_') . 'test_'));
|
||||
return strtolower($this->getUniqueID($this->config->getSystemValueString('dbtableprefix', 'oc_') . 'test_'));
|
||||
}
|
||||
|
||||
protected function tearDown(): void {
|
||||
|
|
@ -160,10 +160,10 @@ class MigratorTest extends \Test\TestCase {
|
|||
}
|
||||
|
||||
public function testUpgradeDifferentPrefix() {
|
||||
$oldTablePrefix = $this->config->getSystemValue('dbtableprefix', 'oc_');
|
||||
$oldTablePrefix = $this->config->getSystemValueString('dbtableprefix', 'oc_');
|
||||
|
||||
$this->config->setSystemValue('dbtableprefix', 'ownc_');
|
||||
$this->tableName = strtolower($this->getUniqueID($this->config->getSystemValue('dbtableprefix') . 'test_'));
|
||||
$this->tableName = strtolower($this->getUniqueID($this->config->getSystemValueString('dbtableprefix') . 'test_'));
|
||||
|
||||
[$startSchema, $endSchema] = $this->getDuplicateKeySchemas();
|
||||
$migrator = $this->getMigrator();
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ class StorageTest extends TestCase {
|
|||
}
|
||||
|
||||
public function testSetFileKey() {
|
||||
$this->config->method('getSystemValue')
|
||||
$this->config->method('getSystemValueString')
|
||||
->with('version')
|
||||
->willReturn('20.0.0.2');
|
||||
$this->util->expects($this->any())
|
||||
|
|
@ -103,7 +103,7 @@ class StorageTest extends TestCase {
|
|||
}
|
||||
|
||||
public function testSetFileOld() {
|
||||
$this->config->method('getSystemValue')
|
||||
$this->config->method('getSystemValueString')
|
||||
->with('version')
|
||||
->willReturn('20.0.0.0');
|
||||
$this->util->expects($this->any())
|
||||
|
|
@ -145,7 +145,7 @@ class StorageTest extends TestCase {
|
|||
* @param string $expectedKeyContent
|
||||
*/
|
||||
public function testGetFileKey($path, $strippedPartialName, $originalKeyExists, $expectedKeyContent) {
|
||||
$this->config->method('getSystemValue')
|
||||
$this->config->method('getSystemValueString')
|
||||
->with('version')
|
||||
->willReturn('20.0.0.2');
|
||||
$this->util->expects($this->any())
|
||||
|
|
@ -201,7 +201,7 @@ class StorageTest extends TestCase {
|
|||
}
|
||||
|
||||
public function testSetFileKeySystemWide() {
|
||||
$this->config->method('getSystemValue')
|
||||
$this->config->method('getSystemValueString')
|
||||
->with('version')
|
||||
->willReturn('20.0.0.2');
|
||||
|
||||
|
|
@ -233,7 +233,7 @@ class StorageTest extends TestCase {
|
|||
}
|
||||
|
||||
public function testGetFileKeySystemWide() {
|
||||
$this->config->method('getSystemValue')
|
||||
$this->config->method('getSystemValueString')
|
||||
->with('version')
|
||||
->willReturn('20.0.0.2');
|
||||
|
||||
|
|
@ -261,7 +261,7 @@ class StorageTest extends TestCase {
|
|||
}
|
||||
|
||||
public function testSetSystemUserKey() {
|
||||
$this->config->method('getSystemValue')
|
||||
$this->config->method('getSystemValueString')
|
||||
->with('version')
|
||||
->willReturn('20.0.0.2');
|
||||
|
||||
|
|
@ -281,7 +281,7 @@ class StorageTest extends TestCase {
|
|||
}
|
||||
|
||||
public function testSetUserKey() {
|
||||
$this->config->method('getSystemValue')
|
||||
$this->config->method('getSystemValueString')
|
||||
->with('version')
|
||||
->willReturn('20.0.0.2');
|
||||
|
||||
|
|
@ -301,7 +301,7 @@ class StorageTest extends TestCase {
|
|||
}
|
||||
|
||||
public function testGetSystemUserKey() {
|
||||
$this->config->method('getSystemValue')
|
||||
$this->config->method('getSystemValueString')
|
||||
->with('version')
|
||||
->willReturn('20.0.0.2');
|
||||
|
||||
|
|
@ -324,7 +324,7 @@ class StorageTest extends TestCase {
|
|||
}
|
||||
|
||||
public function testGetUserKey() {
|
||||
$this->config->method('getSystemValue')
|
||||
$this->config->method('getSystemValueString')
|
||||
->with('version')
|
||||
->willReturn('20.0.0.2');
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class ManagerTest extends TestCase {
|
|||
}
|
||||
|
||||
public function testManagerIsEnabled() {
|
||||
$this->config->expects($this->any())->method('getSystemValue')->willReturn(true);
|
||||
$this->config->expects($this->any())->method('getSystemValueBool')->willReturn(true);
|
||||
$this->config->expects($this->any())->method('getAppValue')->willReturn('yes');
|
||||
$this->assertTrue($this->manager->isEnabled());
|
||||
}
|
||||
|
|
@ -199,7 +199,7 @@ class ManagerTest extends TestCase {
|
|||
// */
|
||||
// public function testModuleRegistration() {
|
||||
// $config = $this->createMock(IConfig::class);
|
||||
// $config->expects($this->any())->method('getSystemValue')->willReturn(true);
|
||||
// $config->expects($this->any())->method('getSystemValueBool')->willReturn(true);
|
||||
// $em = $this->createMock(IEncryptionModule::class);
|
||||
// $em->expects($this->any())->method('getId')->willReturn(0);
|
||||
// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0');
|
||||
|
|
@ -211,7 +211,7 @@ class ManagerTest extends TestCase {
|
|||
//
|
||||
// public function testModuleUnRegistration() {
|
||||
// $config = $this->createMock(IConfig::class);
|
||||
// $config->expects($this->any())->method('getSystemValue')->willReturn(true);
|
||||
// $config->expects($this->any())->method('getSystemValueBool')->willReturn(true);
|
||||
// $em = $this->createMock(IEncryptionModule::class);
|
||||
// $em->expects($this->any())->method('getId')->willReturn(0);
|
||||
// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0');
|
||||
|
|
@ -228,7 +228,7 @@ class ManagerTest extends TestCase {
|
|||
// */
|
||||
// public function testGetEncryptionModuleUnknown() {
|
||||
// $config = $this->createMock(IConfig::class);
|
||||
// $config->expects($this->any())->method('getSystemValue')->willReturn(true);
|
||||
// $config->expects($this->any())->method('getSystemValueBool')->willReturn(true);
|
||||
// $em = $this->createMock(IEncryptionModule::class);
|
||||
// $em->expects($this->any())->method('getId')->willReturn(0);
|
||||
// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0');
|
||||
|
|
@ -240,7 +240,7 @@ class ManagerTest extends TestCase {
|
|||
//
|
||||
// public function testGetEncryptionModule() {
|
||||
// $config = $this->createMock(IConfig::class);
|
||||
// $config->expects($this->any())->method('getSystemValue')->willReturn(true);
|
||||
// $config->expects($this->any())->method('getSystemValueBool')->willReturn(true);
|
||||
// $em = $this->createMock(IEncryptionModule::class);
|
||||
// $em->expects($this->any())->method('getId')->willReturn(0);
|
||||
// $em->expects($this->any())->method('getDisplayName')->willReturn('TestDummyModule0');
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ class EtagTest extends \Test\TestCase {
|
|||
\OC\Share\Share::registerBackend('folder', 'OCA\Files_Sharing\ShareBackend\Folder', 'file');
|
||||
|
||||
$config = \OC::$server->getConfig();
|
||||
$this->datadir = $config->getSystemValue('datadirectory');
|
||||
$this->datadir = $config->getSystemValueString('datadirectory');
|
||||
$this->tmpDir = \OC::$server->getTempManager()->getTemporaryFolder();
|
||||
$config->setSystemValue('datadirectory', $this->tmpDir);
|
||||
|
||||
|
|
|
|||
|
|
@ -347,7 +347,7 @@ class FilesystemTest extends \Test\TestCase {
|
|||
\OC\Files\Filesystem::initMountPoints($userId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function testNullUserThrows() {
|
||||
$this->expectException(\OC\User\NoUserException::class);
|
||||
|
||||
|
|
@ -427,7 +427,7 @@ class FilesystemTest extends \Test\TestCase {
|
|||
public function testMountDefaultCacheDir() {
|
||||
$userId = $this->getUniqueID('user_');
|
||||
$config = \OC::$server->getConfig();
|
||||
$oldCachePath = $config->getSystemValue('cache_path', '');
|
||||
$oldCachePath = $config->getSystemValueString('cache_path', '');
|
||||
// no cache path configured
|
||||
$config->setSystemValue('cache_path', '');
|
||||
|
||||
|
|
@ -457,7 +457,7 @@ class FilesystemTest extends \Test\TestCase {
|
|||
$userId = $this->getUniqueID('user_');
|
||||
|
||||
$config = \OC::$server->getConfig();
|
||||
$oldCachePath = $config->getSystemValue('cache_path', '');
|
||||
$oldCachePath = $config->getSystemValueString('cache_path', '');
|
||||
// set cache path to temp dir
|
||||
$cachePath = \OC::$server->getTempManager()->getTemporaryFolder() . '/extcache';
|
||||
$config->setSystemValue('cache_path', $cachePath);
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ class ConfigTest extends TestCase {
|
|||
|
||||
public function testIsGlobalScaleEnabled() {
|
||||
$gsConfig = $this->getInstance();
|
||||
$this->config->expects($this->once())->method('getSystemValue')
|
||||
$this->config->expects($this->once())->method('getSystemValueBool')
|
||||
->with('gs.enabled', false)->willReturn(true);
|
||||
|
||||
$result = $gsConfig->isGlobalScaleEnabled();
|
||||
|
|
@ -73,7 +73,7 @@ class ConfigTest extends TestCase {
|
|||
|
||||
$gsConfig->expects($this->any())->method('isGlobalScaleEnabled')->willReturn($gsEnabled);
|
||||
|
||||
$this->config->expects($this->any())->method('getSystemValue')
|
||||
$this->config->expects($this->any())->method('getSystemValueString')
|
||||
->with('gs.federation', 'internal')->willReturn($gsFederation);
|
||||
|
||||
$this->assertSame($expected, $gsConfig->onlyInternalFederation());
|
||||
|
|
|
|||
|
|
@ -54,22 +54,25 @@ class ClientTest extends \Test\TestCase {
|
|||
|
||||
public function testGetProxyUri(): void {
|
||||
$this->config
|
||||
->method('getSystemValue')
|
||||
->with('proxy', null)
|
||||
->willReturn(null);
|
||||
->method('getSystemValueString')
|
||||
->with('proxy', '')
|
||||
->willReturn('');
|
||||
$this->assertNull(self::invokePrivate($this->client, 'getProxyUri'));
|
||||
}
|
||||
|
||||
public function testGetProxyUriProxyHostEmptyPassword(): void {
|
||||
$map = [
|
||||
['proxy', '', 'foo'],
|
||||
['proxyuserpwd', '', null],
|
||||
['proxyexclude', [], []],
|
||||
];
|
||||
|
||||
$this->config
|
||||
->method('getSystemValue')
|
||||
->will($this->returnValueMap($map));
|
||||
->will($this->returnValueMap([
|
||||
['proxyexclude', [], []],
|
||||
]));
|
||||
|
||||
$this->config
|
||||
->method('getSystemValueString')
|
||||
->will($this->returnValueMap([
|
||||
['proxy', '', 'foo'],
|
||||
['proxyuserpwd', '', ''],
|
||||
]));
|
||||
|
||||
$this->assertEquals([
|
||||
'http' => 'foo',
|
||||
|
|
@ -79,32 +82,20 @@ class ClientTest extends \Test\TestCase {
|
|||
|
||||
public function testGetProxyUriProxyHostWithPassword(): void {
|
||||
$this->config
|
||||
->expects($this->exactly(3))
|
||||
->expects($this->once())
|
||||
->method('getSystemValue')
|
||||
->with('proxyexclude', [])
|
||||
->willReturn([]);
|
||||
$this->config
|
||||
->expects($this->exactly(2))
|
||||
->method('getSystemValueString')
|
||||
->withConsecutive(
|
||||
[
|
||||
$this->equalTo('proxy'),
|
||||
$this->callback(function ($input) {
|
||||
return $input === '';
|
||||
})
|
||||
],
|
||||
[
|
||||
$this->equalTo('proxyuserpwd'),
|
||||
$this->callback(function ($input) {
|
||||
return $input === '';
|
||||
})
|
||||
],
|
||||
[
|
||||
$this->equalTo('proxyexclude'),
|
||||
$this->callback(function ($input) {
|
||||
return $input === [];
|
||||
})
|
||||
],
|
||||
['proxy', ''],
|
||||
['proxyuserpwd', ''],
|
||||
)
|
||||
->willReturnOnConsecutiveCalls(
|
||||
'foo',
|
||||
'username:password',
|
||||
[],
|
||||
);
|
||||
$this->assertEquals([
|
||||
'http' => 'username:password@foo',
|
||||
|
|
@ -114,32 +105,20 @@ class ClientTest extends \Test\TestCase {
|
|||
|
||||
public function testGetProxyUriProxyHostWithPasswordAndExclude(): void {
|
||||
$this->config
|
||||
->expects($this->exactly(3))
|
||||
->expects($this->once())
|
||||
->method('getSystemValue')
|
||||
->with('proxyexclude', [])
|
||||
->willReturn(['bar']);
|
||||
$this->config
|
||||
->expects($this->exactly(2))
|
||||
->method('getSystemValueString')
|
||||
->withConsecutive(
|
||||
[
|
||||
$this->equalTo('proxy'),
|
||||
$this->callback(function ($input) {
|
||||
return $input === '';
|
||||
})
|
||||
],
|
||||
[
|
||||
$this->equalTo('proxyuserpwd'),
|
||||
$this->callback(function ($input) {
|
||||
return $input === '';
|
||||
})
|
||||
],
|
||||
[
|
||||
$this->equalTo('proxyexclude'),
|
||||
$this->callback(function ($input) {
|
||||
return $input === [];
|
||||
})
|
||||
],
|
||||
['proxy', ''],
|
||||
['proxyuserpwd', ''],
|
||||
)
|
||||
->willReturnOnConsecutiveCalls(
|
||||
'foo',
|
||||
'username:password',
|
||||
['bar'],
|
||||
);
|
||||
$this->assertEquals([
|
||||
'http' => 'username:password@foo',
|
||||
|
|
@ -271,19 +250,23 @@ class ClientTest extends \Test\TestCase {
|
|||
}
|
||||
|
||||
private function setUpDefaultRequestOptions(): void {
|
||||
$map = [
|
||||
['proxy', '', 'foo'],
|
||||
['proxyuserpwd', '', null],
|
||||
['proxyexclude', [], []],
|
||||
];
|
||||
|
||||
$this->config
|
||||
->method('getSystemValue')
|
||||
->will($this->returnValueMap($map));
|
||||
->will($this->returnValueMap([
|
||||
['proxyexclude', [], []],
|
||||
]));
|
||||
$this->config
|
||||
->method('getSystemValueString')
|
||||
->will($this->returnValueMap([
|
||||
['proxy', '', 'foo'],
|
||||
['proxyuserpwd', '', ''],
|
||||
]));
|
||||
$this->config
|
||||
->method('getSystemValueBool')
|
||||
->with('allow_local_remote_servers', false)
|
||||
->willReturn(true);
|
||||
->will($this->returnValueMap([
|
||||
['installed', false, true],
|
||||
['allow_local_remote_servers', false, true],
|
||||
]));
|
||||
|
||||
$this->certificateManager
|
||||
->expects($this->once())
|
||||
|
|
@ -467,15 +450,20 @@ class ClientTest extends \Test\TestCase {
|
|||
public function testSetDefaultOptionsWithNotInstalled(): void {
|
||||
$this->config
|
||||
->expects($this->exactly(2))
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->withConsecutive(
|
||||
['proxy', ''],
|
||||
['installed', false],
|
||||
['allow_local_remote_servers', false],
|
||||
)
|
||||
->willReturnOnConsecutiveCalls(
|
||||
'',
|
||||
false,
|
||||
false,
|
||||
);
|
||||
$this->config
|
||||
->expects($this->once())
|
||||
->method('getSystemValueString')
|
||||
->with('proxy', '')
|
||||
->willReturn('');
|
||||
$this->certificateManager
|
||||
->expects($this->never())
|
||||
->method('listCertificates');
|
||||
|
|
@ -503,19 +491,31 @@ class ClientTest extends \Test\TestCase {
|
|||
|
||||
public function testSetDefaultOptionsWithProxy(): void {
|
||||
$this->config
|
||||
->expects($this->exactly(4))
|
||||
->expects($this->exactly(2))
|
||||
->method('getSystemValueBool')
|
||||
->withConsecutive(
|
||||
['installed', false],
|
||||
['allow_local_remote_servers', false],
|
||||
)
|
||||
->willReturnOnConsecutiveCalls(
|
||||
true,
|
||||
false,
|
||||
);
|
||||
$this->config
|
||||
->expects($this->once())
|
||||
->method('getSystemValue')
|
||||
->with('proxyexclude', [])
|
||||
->willReturn([]);
|
||||
$this->config
|
||||
->expects($this->exactly(2))
|
||||
->method('getSystemValueString')
|
||||
->withConsecutive(
|
||||
['proxy', ''],
|
||||
['proxyuserpwd', ''],
|
||||
['proxyexclude', []],
|
||||
['installed', false],
|
||||
)
|
||||
->willReturnOnConsecutiveCalls(
|
||||
'foo',
|
||||
'',
|
||||
[],
|
||||
true,
|
||||
);
|
||||
$this->certificateManager
|
||||
->expects($this->once())
|
||||
|
|
@ -550,19 +550,31 @@ class ClientTest extends \Test\TestCase {
|
|||
|
||||
public function testSetDefaultOptionsWithProxyAndExclude(): void {
|
||||
$this->config
|
||||
->expects($this->exactly(4))
|
||||
->expects($this->exactly(2))
|
||||
->method('getSystemValueBool')
|
||||
->withConsecutive(
|
||||
['installed', false],
|
||||
['allow_local_remote_servers', false],
|
||||
)
|
||||
->willReturnOnConsecutiveCalls(
|
||||
true,
|
||||
false,
|
||||
);
|
||||
$this->config
|
||||
->expects($this->once())
|
||||
->method('getSystemValue')
|
||||
->with('proxyexclude', [])
|
||||
->willReturn(['bar']);
|
||||
$this->config
|
||||
->expects($this->exactly(2))
|
||||
->method('getSystemValueString')
|
||||
->withConsecutive(
|
||||
['proxy', ''],
|
||||
['proxyuserpwd', ''],
|
||||
['proxyexclude', []],
|
||||
['installed', false],
|
||||
)
|
||||
->willReturnOnConsecutiveCalls(
|
||||
'foo',
|
||||
'',
|
||||
['bar'],
|
||||
true,
|
||||
);
|
||||
$this->certificateManager
|
||||
->expects($this->once())
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ class CheckerTest extends TestCase {
|
|||
->willReturn('stable');
|
||||
$this->config
|
||||
->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('integrity.check.disabled', false)
|
||||
->willReturn(false);
|
||||
|
||||
|
|
@ -184,7 +184,7 @@ class CheckerTest extends TestCase {
|
|||
->willReturn('stable');
|
||||
$this->config
|
||||
->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('integrity.check.disabled', false)
|
||||
->willReturn(false);
|
||||
|
||||
|
|
@ -223,7 +223,7 @@ class CheckerTest extends TestCase {
|
|||
->willReturn('stable');
|
||||
$this->config
|
||||
->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('integrity.check.disabled', false)
|
||||
->willReturn(false);
|
||||
|
||||
|
|
@ -268,7 +268,7 @@ class CheckerTest extends TestCase {
|
|||
->willReturn('stable');
|
||||
$this->config
|
||||
->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('integrity.check.disabled', false)
|
||||
->willReturn(false);
|
||||
|
||||
|
|
@ -329,7 +329,7 @@ class CheckerTest extends TestCase {
|
|||
->willReturn('stable');
|
||||
$this->config
|
||||
->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('integrity.check.disabled', false)
|
||||
->willReturn(false);
|
||||
|
||||
|
|
@ -389,7 +389,7 @@ class CheckerTest extends TestCase {
|
|||
->willReturn('stable');
|
||||
$this->config
|
||||
->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('integrity.check.disabled', false)
|
||||
->willReturn(false);
|
||||
|
||||
|
|
@ -433,7 +433,7 @@ class CheckerTest extends TestCase {
|
|||
->willReturn('stable');
|
||||
$this->config
|
||||
->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('integrity.check.disabled', false)
|
||||
->willReturn(false);
|
||||
|
||||
|
|
@ -654,7 +654,7 @@ class CheckerTest extends TestCase {
|
|||
->willReturn('stable');
|
||||
$this->config
|
||||
->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('integrity.check.disabled', false)
|
||||
->willReturn(false);
|
||||
|
||||
|
|
@ -674,7 +674,7 @@ class CheckerTest extends TestCase {
|
|||
->willReturn('stable');
|
||||
$this->config
|
||||
->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('integrity.check.disabled', false)
|
||||
->willReturn(false);
|
||||
|
||||
|
|
@ -711,7 +711,7 @@ class CheckerTest extends TestCase {
|
|||
->willReturn('stable');
|
||||
$this->config
|
||||
->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('integrity.check.disabled', false)
|
||||
->willReturn(false);
|
||||
|
||||
|
|
@ -774,7 +774,7 @@ class CheckerTest extends TestCase {
|
|||
->willReturn('stable');
|
||||
$this->config
|
||||
->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('integrity.check.disabled', false)
|
||||
->willReturn(false);
|
||||
|
||||
|
|
@ -801,7 +801,7 @@ class CheckerTest extends TestCase {
|
|||
->willReturn('stable');
|
||||
$this->config
|
||||
->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('integrity.check.disabled', false)
|
||||
->willReturn(false);
|
||||
|
||||
|
|
@ -838,7 +838,7 @@ class CheckerTest extends TestCase {
|
|||
->willReturn('stable');
|
||||
$this->config
|
||||
->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('integrity.check.disabled', false)
|
||||
->willReturn(false);
|
||||
|
||||
|
|
@ -881,7 +881,7 @@ class CheckerTest extends TestCase {
|
|||
->willReturn('stable');
|
||||
$this->config
|
||||
->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('integrity.check.disabled', false)
|
||||
->willReturn(false);
|
||||
|
||||
|
|
@ -939,7 +939,7 @@ class CheckerTest extends TestCase {
|
|||
->willReturn('stable');
|
||||
$this->config
|
||||
->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('integrity.check.disabled', false)
|
||||
->willReturn(false);
|
||||
|
||||
|
|
@ -982,7 +982,7 @@ class CheckerTest extends TestCase {
|
|||
->willReturn('stable');
|
||||
$this->config
|
||||
->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('integrity.check.disabled', false)
|
||||
->willReturn(false);
|
||||
|
||||
|
|
@ -1104,7 +1104,7 @@ class CheckerTest extends TestCase {
|
|||
->willReturn('stable');
|
||||
$this->config
|
||||
->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('integrity.check.disabled', false)
|
||||
->willReturn(true);
|
||||
|
||||
|
|
@ -1134,7 +1134,7 @@ class CheckerTest extends TestCase {
|
|||
->willReturn($channel);
|
||||
$this->config
|
||||
->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('integrity.check.disabled', false)
|
||||
->willReturn(false);
|
||||
|
||||
|
|
@ -1152,7 +1152,7 @@ class CheckerTest extends TestCase {
|
|||
->willReturn($channel);
|
||||
$this->config
|
||||
->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('integrity.check.disabled', false)
|
||||
->willReturn(true);
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,12 @@ class FactoryTest extends TestCase {
|
|||
$this->cacheFactory = $this->createMock(ICacheFactory::class);
|
||||
|
||||
$this->serverRoot = \OC::$SERVERROOT;
|
||||
|
||||
$this->config
|
||||
->method('getSystemValueBool')
|
||||
->willReturnMap([
|
||||
['installed', false, true],
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -121,14 +127,12 @@ class FactoryTest extends TestCase {
|
|||
true,
|
||||
);
|
||||
$this->config
|
||||
->expects($this->exactly(2))
|
||||
->expects($this->exactly(1))
|
||||
->method('getSystemValue')
|
||||
->withConsecutive(
|
||||
['force_language', false],
|
||||
['installed', false],
|
||||
)->willReturnOnConsecutiveCalls(
|
||||
false,
|
||||
true,
|
||||
);
|
||||
$user = $this->getMockBuilder(IUser::class)
|
||||
->getMock();
|
||||
|
|
@ -159,11 +163,10 @@ class FactoryTest extends TestCase {
|
|||
['MyApp', 'es', true],
|
||||
]);
|
||||
$this->config
|
||||
->expects($this->exactly(3))
|
||||
->expects($this->exactly(2))
|
||||
->method('getSystemValue')
|
||||
->willReturnMap([
|
||||
['force_language', false, false],
|
||||
['installed', false, true],
|
||||
['default_language', false, 'es']
|
||||
]);
|
||||
$user = $this->getMockBuilder(IUser::class)
|
||||
|
|
@ -195,11 +198,10 @@ class FactoryTest extends TestCase {
|
|||
['MyApp', 'es', false],
|
||||
]);
|
||||
$this->config
|
||||
->expects($this->exactly(3))
|
||||
->expects($this->exactly(2))
|
||||
->method('getSystemValue')
|
||||
->willReturnMap([
|
||||
['force_language', false, false],
|
||||
['installed', false, true],
|
||||
['default_language', false, 'es']
|
||||
]);
|
||||
$user = $this->getMockBuilder(IUser::class)
|
||||
|
|
@ -234,11 +236,10 @@ class FactoryTest extends TestCase {
|
|||
['MyApp', 'es', false],
|
||||
]);
|
||||
$this->config
|
||||
->expects($this->exactly(3))
|
||||
->expects($this->exactly(2))
|
||||
->method('getSystemValue')
|
||||
->willReturnMap([
|
||||
['force_language', false, false],
|
||||
['installed', false, true],
|
||||
['default_language', false, 'es']
|
||||
]);
|
||||
$user = $this->getMockBuilder(IUser::class)
|
||||
|
|
@ -319,7 +320,7 @@ class FactoryTest extends TestCase {
|
|||
->willReturn($this->serverRoot . '/apps/files/l10n/');
|
||||
$this->config
|
||||
->expects(self::once())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->with('theme')
|
||||
->willReturn('abc');
|
||||
|
||||
|
|
@ -474,9 +475,7 @@ class FactoryTest extends TestCase {
|
|||
$this->config->expects(self::any())
|
||||
->method('getSystemValue')
|
||||
->willReturnCallback(function ($var, $default) use ($defaultLang) {
|
||||
if ($var === 'installed') {
|
||||
return true;
|
||||
} elseif ($var === 'default_language') {
|
||||
if ($var === 'default_language') {
|
||||
return $defaultLang;
|
||||
} else {
|
||||
return $default;
|
||||
|
|
@ -562,12 +561,11 @@ class FactoryTest extends TestCase {
|
|||
|
||||
public function testFindGenericLanguageByUserLanguage(): void {
|
||||
$factory = $this->getFactory();
|
||||
$this->config->expects(self::exactly(3))
|
||||
$this->config->expects(self::exactly(2))
|
||||
->method('getSystemValue')
|
||||
->willReturnMap([
|
||||
['force_language', false, false,],
|
||||
['default_language', false, false,],
|
||||
['installed', false, true],
|
||||
]);
|
||||
$user = $this->createMock(IUser::class);
|
||||
$this->userSession->expects(self::once())
|
||||
|
|
@ -590,7 +588,6 @@ class FactoryTest extends TestCase {
|
|||
->willReturnMap([
|
||||
['force_language', false, false,],
|
||||
['default_language', false, false,],
|
||||
['installed', false, true],
|
||||
]);
|
||||
$user = $this->createMock(IUser::class);
|
||||
$this->userSession->expects(self::once())
|
||||
|
|
@ -621,7 +618,6 @@ class FactoryTest extends TestCase {
|
|||
->willReturnMap([
|
||||
['force_language', false, false,],
|
||||
['default_language', false, false,],
|
||||
['installed', false, true],
|
||||
]);
|
||||
$user = $this->createMock(IUser::class);
|
||||
$this->userSession->expects(self::once())
|
||||
|
|
|
|||
|
|
@ -82,6 +82,10 @@ class LanguageIteratorTest extends TestCase {
|
|||
->method('getSystemValue')
|
||||
->willReturnMap([
|
||||
['force_language', false, $forcedLang],
|
||||
]);
|
||||
$this->config->expects($this->any())
|
||||
->method('getSystemValueString')
|
||||
->willReturnMap([
|
||||
['default_language', 'en', $sysLang],
|
||||
]);
|
||||
$this->config->expects($this->any())
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ class MailerTest extends TestCase {
|
|||
public function testGetSendmailInstanceSendMail($sendmailMode, $binaryParam) {
|
||||
$this->config
|
||||
->expects($this->exactly(2))
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->willReturnMap([
|
||||
['mail_smtpmode', 'smtp', 'sendmail'],
|
||||
['mail_sendmailmode', 'smtp', $sendmailMode],
|
||||
|
|
@ -107,7 +107,7 @@ class MailerTest extends TestCase {
|
|||
public function testGetSendmailInstanceSendMailQmail($sendmailMode, $binaryParam) {
|
||||
$this->config
|
||||
->expects($this->exactly(2))
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->willReturnMap([
|
||||
['mail_smtpmode', 'smtp', 'qmail'],
|
||||
['mail_sendmailmode', 'smtp', $sendmailMode],
|
||||
|
|
@ -133,7 +133,7 @@ class MailerTest extends TestCase {
|
|||
|
||||
public function testGetInstanceSendmail() {
|
||||
$this->config
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->willReturnMap([
|
||||
['mail_smtpmode', 'smtp', 'sendmail'],
|
||||
['mail_sendmailmode', 'smtp', 'smtp'],
|
||||
|
|
@ -180,7 +180,7 @@ class MailerTest extends TestCase {
|
|||
public function testCreateMessage() {
|
||||
$this->config
|
||||
->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('mail_send_plaintext_only', false)
|
||||
->willReturn(false);
|
||||
$this->assertInstanceOf('\OC\Mail\Message', $this->mailer->createMessage());
|
||||
|
|
@ -229,7 +229,7 @@ class MailerTest extends TestCase {
|
|||
}
|
||||
|
||||
public function testCreateEMailTemplate() {
|
||||
$this->config->method('getSystemValue')
|
||||
$this->config->method('getSystemValueString')
|
||||
->with('mail_template_class', '')
|
||||
->willReturnArgument(1);
|
||||
|
||||
|
|
@ -239,12 +239,16 @@ class MailerTest extends TestCase {
|
|||
public function testStreamingOptions() {
|
||||
$this->config->method('getSystemValue')
|
||||
->willReturnMap([
|
||||
['mail_smtpmode', 'smtp', 'smtp'],
|
||||
['mail_smtpstreamoptions', [], ['foo' => 1]],
|
||||
['mail_smtphost', '127.0.0.1', '127.0.0.1'],
|
||||
['mail_smtpport', 25, 25],
|
||||
['mail_smtptimeout', 10, 10],
|
||||
]);
|
||||
$this->config->method('getSystemValueString')
|
||||
->willReturnMap([
|
||||
['mail_smtpmode', 'smtp', 'smtp'],
|
||||
['overwrite.cli.url', '', ''],
|
||||
]);
|
||||
$mailer = self::invokePrivate($this->mailer, 'getInstance');
|
||||
/** @var EsmtpTransport $transport */
|
||||
$transport = self::invokePrivate($mailer, 'transport');
|
||||
|
|
@ -256,12 +260,16 @@ class MailerTest extends TestCase {
|
|||
public function testStreamingOptionsWrongType() {
|
||||
$this->config->method('getSystemValue')
|
||||
->willReturnMap([
|
||||
['mail_smtpmode', 'smtp', 'smtp'],
|
||||
['mail_smtpstreamoptions', [], 'bar'],
|
||||
['mail_smtphost', '127.0.0.1', '127.0.0.1'],
|
||||
['mail_smtpport', 25, 25],
|
||||
['mail_smtptimeout', 10, 10],
|
||||
]);
|
||||
$this->config->method('getSystemValueString')
|
||||
->willReturnMap([
|
||||
['mail_smtpmode', 'smtp', 'smtp'],
|
||||
['overwrite.cli.url', '', ''],
|
||||
]);
|
||||
$mailer = self::invokePrivate($this->mailer, 'getInstance');
|
||||
/** @var EsmtpTransport $transport */
|
||||
$transport = self::invokePrivate($mailer, 'transport');
|
||||
|
|
@ -272,14 +280,15 @@ class MailerTest extends TestCase {
|
|||
public function testLocalDomain(): void {
|
||||
$this->config->method('getSystemValue')
|
||||
->willReturnMap([
|
||||
['mail_smtpmode', 'smtp', 'smtp'],
|
||||
['mail_smtphost', '127.0.0.1', '127.0.0.1'],
|
||||
['mail_smtpport', 25, 25],
|
||||
['mail_smtptimeout', 10, 10],
|
||||
]);
|
||||
$this->config->method('getSystemValueString')
|
||||
->with('overwrite.cli.url', '')
|
||||
->willReturn('https://some.valid.url.com:8080');
|
||||
->willReturnMap([
|
||||
['mail_smtpmode', 'smtp', 'smtp'],
|
||||
['overwrite.cli.url', '', 'https://some.valid.url.com:8080'],
|
||||
]);
|
||||
|
||||
/** @var SymfonyMailer $mailer */
|
||||
$mailer = self::invokePrivate($this->mailer, 'getInstance');
|
||||
|
|
@ -294,14 +303,15 @@ class MailerTest extends TestCase {
|
|||
public function testLocalDomainInvalidUrl(): void {
|
||||
$this->config->method('getSystemValue')
|
||||
->willReturnMap([
|
||||
['mail_smtpmode', 'smtp', 'smtp'],
|
||||
['mail_smtphost', '127.0.0.1', '127.0.0.1'],
|
||||
['mail_smtpport', 25, 25],
|
||||
['mail_smtptimeout', 10, 10],
|
||||
['mail_smtphost', '127.0.0.1', '127.0.0.1'],
|
||||
]);
|
||||
$this->config->method('getSystemValueString')
|
||||
->with('overwrite.cli.url', '')
|
||||
->willReturn('https:only.slash.does.not.work:8080');
|
||||
->willReturnMap([
|
||||
['mail_smtpmode', 'smtp', 'smtp'],
|
||||
['overwrite.cli.url', '', 'https:only.slash.does.not.work:8080'],
|
||||
]);
|
||||
|
||||
/** @var SymfonyMailer $mailer */
|
||||
$mailer = self::invokePrivate($this->mailer, 'getInstance');
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ class ClearGeneratedAvatarCacheTest extends \Test\TestCase {
|
|||
*/
|
||||
public function testShouldRun($from, $expected) {
|
||||
$this->config->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->with('version', '0.0.0.0')
|
||||
->willReturn($from);
|
||||
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ class RepairCollationTest extends TestCase {
|
|||
$this->markTestSkipped("Test only relevant on MySql");
|
||||
}
|
||||
|
||||
$dbPrefix = $this->config->getSystemValue("dbtableprefix");
|
||||
$dbPrefix = $this->config->getSystemValueString("dbtableprefix");
|
||||
$this->tableName = $this->getUniqueID($dbPrefix . "_collation_test");
|
||||
$this->connection->prepare("CREATE TABLE $this->tableName(text VARCHAR(16)) COLLATE utf8_unicode_ci")->execute();
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ class RepairDavSharesTest extends TestCase {
|
|||
|
||||
public function testRun() {
|
||||
$this->config->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->with('version', '0.0.0')
|
||||
->willReturn('20.0.2');
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ class RepairInvalidSharesTest extends TestCase {
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$config->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->with('version')
|
||||
->willReturn('12.0.0.0');
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class RepairMimeTypesTest extends \Test\TestCase {
|
|||
->disableOriginalConstructor()
|
||||
->getMock();
|
||||
$config->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->with('version')
|
||||
->willReturn('11.0.0.0');
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class RepairSqliteAutoincrementTest extends \Test\TestCase {
|
|||
$this->markTestSkipped("Test only relevant on Sqlite");
|
||||
}
|
||||
|
||||
$dbPrefix = $this->config->getSystemValue('dbtableprefix', 'oc_');
|
||||
$dbPrefix = $this->config->getSystemValueString('dbtableprefix', 'oc_');
|
||||
$this->tableName = $this->getUniqueID($dbPrefix . 'autoinc_test');
|
||||
$this->connection->prepare('CREATE TABLE ' . $this->tableName . '("someid" INTEGER NOT NULL, "text" VARCHAR(16), PRIMARY KEY("someid"))')->execute();
|
||||
|
||||
|
|
|
|||
|
|
@ -183,7 +183,7 @@ class ThrottlerTest extends TestCase {
|
|||
->willReturn(array_keys($whitelists));
|
||||
$this->config
|
||||
->expects($this->once())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueBool')
|
||||
->with('auth.bruteforce.protection.enabled', true)
|
||||
->willReturn($enabled);
|
||||
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class CertificateManagerTest extends \Test\TestCase {
|
|||
\OC_Util::setupFS($this->username);
|
||||
|
||||
$config = $this->createMock(IConfig::class);
|
||||
$config->expects($this->any())->method('getSystemValue')
|
||||
$config->expects($this->any())->method('getSystemValueBool')
|
||||
->with('installed', false)->willReturn(true);
|
||||
|
||||
$this->random = $this->createMock(ISecureRandom::class);
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ class HasherTest extends \Test\TestCase {
|
|||
$this->markTestSkipped('Need ARGON2 support to test ARGON2 hashes');
|
||||
}
|
||||
|
||||
$this->config->method('getSystemValue')
|
||||
$this->config->method('getSystemValueBool')
|
||||
->with('hashing_default_password')
|
||||
->willReturn(true);
|
||||
|
||||
|
|
@ -233,7 +233,7 @@ class HasherTest extends \Test\TestCase {
|
|||
$this->markTestSkipped('Need ARGON2ID support to test ARGON2ID hashes');
|
||||
}
|
||||
|
||||
$this->config->method('getSystemValue')
|
||||
$this->config->method('getSystemValueBool')
|
||||
->with('hashing_default_password')
|
||||
->willReturn(false);
|
||||
|
||||
|
|
@ -251,7 +251,7 @@ class HasherTest extends \Test\TestCase {
|
|||
$this->markTestSkipped('Need ARGON2 support to test ARGON2 hashes');
|
||||
}
|
||||
|
||||
$this->config->method('getSystemValue')
|
||||
$this->config->method('getSystemValueBool')
|
||||
->with('hashing_default_password')
|
||||
->willReturn(true);
|
||||
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ class VerificationTokenTest extends TestCase {
|
|||
->with('alice', 'core', 'fingerprintToken', null)
|
||||
->willReturn('encryptedToken');
|
||||
$this->config->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->with('secret')
|
||||
->willReturn('357111317');
|
||||
|
||||
|
|
@ -143,7 +143,7 @@ class VerificationTokenTest extends TestCase {
|
|||
->with('alice', 'core', 'fingerprintToken', null)
|
||||
->willReturn('encryptedToken');
|
||||
$this->config->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->with('secret')
|
||||
->willReturn('357111317');
|
||||
|
||||
|
|
@ -173,7 +173,7 @@ class VerificationTokenTest extends TestCase {
|
|||
->with('alice', 'core', 'fingerprintToken', null)
|
||||
->willReturn('encryptedToken');
|
||||
$this->config->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->with('secret')
|
||||
->willReturn('357111317');
|
||||
|
||||
|
|
@ -207,7 +207,7 @@ class VerificationTokenTest extends TestCase {
|
|||
->with('alice', 'core', 'fingerprintToken', null)
|
||||
->willReturn('encryptedToken');
|
||||
$this->config->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->with('secret')
|
||||
->willReturn('357111317');
|
||||
|
||||
|
|
@ -241,7 +241,7 @@ class VerificationTokenTest extends TestCase {
|
|||
->with('alice', 'core', 'fingerprintToken', null)
|
||||
->willReturn('encryptedToken');
|
||||
$this->config->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->with('secret')
|
||||
->willReturn('357111317');
|
||||
|
||||
|
|
@ -275,7 +275,7 @@ class VerificationTokenTest extends TestCase {
|
|||
->with('alice', 'core', 'fingerprintToken', null)
|
||||
->willReturn('encryptedToken');
|
||||
$this->config->expects($this->any())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueString')
|
||||
->with('secret')
|
||||
->willReturn('357111317');
|
||||
|
||||
|
|
|
|||
|
|
@ -206,7 +206,7 @@ class RegistryTest extends TestCase {
|
|||
->with('one-click-instance')
|
||||
->willReturn(true);
|
||||
$this->config->expects($this->once())
|
||||
->method('getSystemValue')
|
||||
->method('getSystemValueInt')
|
||||
->with('one-click-instance.user-limit')
|
||||
->willReturn($userLimit);
|
||||
$this->config->expects($this->once())
|
||||
|
|
|
|||
|
|
@ -266,7 +266,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase {
|
|||
return self::$realDatabase;
|
||||
});
|
||||
}
|
||||
$dataDir = \OC::$server->getConfig()->getSystemValue('datadirectory', \OC::$SERVERROOT . '/data-autotest');
|
||||
$dataDir = \OC::$server->getConfig()->getSystemValueString('datadirectory', \OC::$SERVERROOT . '/data-autotest');
|
||||
if (self::$wasDatabaseAllowed && \OC::$server->getDatabaseConnection()) {
|
||||
$db = \OC::$server->getDatabaseConnection();
|
||||
if ($db->inTransaction()) {
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue