diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2025-07-24 21:43:07 -0100 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2025-07-29 10:36:44 -0100 |
commit | 132513dbf365702d2078301ea233ba18e978c8b8 (patch) | |
tree | 10ff70e7dbe919d40cce51ea2805ed0c689f165f | |
parent | b8ad6d091a6a4cfdf5becab0b8b6af833fc89a9b (diff) | |
download | nextcloud-server-fix/54080/using-userconfig-to-set-lang.tar.gz nextcloud-server-fix/54080/using-userconfig-to-set-lang.zip |
fix(userconfig): duplicate core lexiconfix/54080/using-userconfig-to-set-lang
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
-rw-r--r-- | core/AppInfo/ConfigLexicon.php | 7 | ||||
-rw-r--r-- | lib/composer/composer/autoload_classmap.php | 1 | ||||
-rw-r--r-- | lib/composer/composer/autoload_static.php | 1 | ||||
-rw-r--r-- | lib/private/AppFramework/Bootstrap/RegistrationContext.php | 3 | ||||
-rw-r--r-- | lib/private/Config/Lexicon/CoreConfigLexicon.php | 43 |
5 files changed, 7 insertions, 48 deletions
diff --git a/core/AppInfo/ConfigLexicon.php b/core/AppInfo/ConfigLexicon.php index 865a0a4728f..df8243019ad 100644 --- a/core/AppInfo/ConfigLexicon.php +++ b/core/AppInfo/ConfigLexicon.php @@ -22,6 +22,8 @@ use OCP\Config\ValueType; class ConfigLexicon implements ILexicon { public const SHAREAPI_ALLOW_FEDERATION_ON_PUBLIC_SHARES = 'shareapi_allow_federation_on_public_shares'; public const SHARE_CUSTOM_TOKEN = 'shareapi_allow_custom_tokens'; + public const USER_LANGUAGE = 'lang'; + public const LASTCRON_TIMESTAMP = 'lastcron'; public function getStrictness(): Strictness { return Strictness::IGNORE; @@ -47,10 +49,13 @@ class ConfigLexicon implements ILexicon { lazy: true, note: 'Shares with guessable tokens may be accessed easily. Shares with custom tokens will continue to be accessible after this setting has been disabled.', ), + new Entry(self::LASTCRON_TIMESTAMP, ValueType::INT, 0, 'timestamp of last cron execution'), ]; } public function getUserConfigs(): array { - return []; + return [ + new Entry(self::USER_LANGUAGE, ValueType::STRING, null, 'language'), + ]; } } diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php index 5ecdfe6a172..3f2dbe5edf9 100644 --- a/lib/composer/composer/autoload_classmap.php +++ b/lib/composer/composer/autoload_classmap.php @@ -1218,7 +1218,6 @@ return array( 'OC\\Comments\\ManagerFactory' => $baseDir . '/lib/private/Comments/ManagerFactory.php', 'OC\\Config' => $baseDir . '/lib/private/Config.php', 'OC\\Config\\ConfigManager' => $baseDir . '/lib/private/Config/ConfigManager.php', - 'OC\\Config\\Lexicon\\CoreConfigLexicon' => $baseDir . '/lib/private/Config/Lexicon/CoreConfigLexicon.php', 'OC\\Config\\UserConfig' => $baseDir . '/lib/private/Config/UserConfig.php', 'OC\\Console\\Application' => $baseDir . '/lib/private/Console/Application.php', 'OC\\Console\\TimestampFormatter' => $baseDir . '/lib/private/Console/TimestampFormatter.php', diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php index ab42cabba21..233b667add9 100644 --- a/lib/composer/composer/autoload_static.php +++ b/lib/composer/composer/autoload_static.php @@ -1259,7 +1259,6 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2 'OC\\Comments\\ManagerFactory' => __DIR__ . '/../../..' . '/lib/private/Comments/ManagerFactory.php', 'OC\\Config' => __DIR__ . '/../../..' . '/lib/private/Config.php', 'OC\\Config\\ConfigManager' => __DIR__ . '/../../..' . '/lib/private/Config/ConfigManager.php', - 'OC\\Config\\Lexicon\\CoreConfigLexicon' => __DIR__ . '/../../..' . '/lib/private/Config/Lexicon/CoreConfigLexicon.php', 'OC\\Config\\UserConfig' => __DIR__ . '/../../..' . '/lib/private/Config/UserConfig.php', 'OC\\Console\\Application' => __DIR__ . '/../../..' . '/lib/private/Console/Application.php', 'OC\\Console\\TimestampFormatter' => __DIR__ . '/../../..' . '/lib/private/Console/TimestampFormatter.php', diff --git a/lib/private/AppFramework/Bootstrap/RegistrationContext.php b/lib/private/AppFramework/Bootstrap/RegistrationContext.php index 94250aad37b..8bd1ff35610 100644 --- a/lib/private/AppFramework/Bootstrap/RegistrationContext.php +++ b/lib/private/AppFramework/Bootstrap/RegistrationContext.php @@ -10,7 +10,6 @@ declare(strict_types=1); namespace OC\AppFramework\Bootstrap; use Closure; -use OC\Config\Lexicon\CoreConfigLexicon; use OC\Support\CrashReport\Registry; use OCP\AppFramework\App; use OCP\AppFramework\Bootstrap\IRegistrationContext; @@ -144,7 +143,7 @@ class RegistrationContext { private array $declarativeSettings = []; /** @var array<array-key, string> */ - private array $configLexiconClasses = ['core' => CoreConfigLexicon::class]; + private array $configLexiconClasses = []; /** @var ServiceRegistration<ITeamResourceProvider>[] */ private array $teamResourceProviders = []; diff --git a/lib/private/Config/Lexicon/CoreConfigLexicon.php b/lib/private/Config/Lexicon/CoreConfigLexicon.php deleted file mode 100644 index de84a58131c..00000000000 --- a/lib/private/Config/Lexicon/CoreConfigLexicon.php +++ /dev/null @@ -1,43 +0,0 @@ -<?php - -declare(strict_types=1); -/** - * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors - * SPDX-License-Identifier: AGPL-3.0-or-later - */ - -namespace OC\Config\Lexicon; - -use OCP\Config\Lexicon\Entry; -use OCP\Config\Lexicon\ILexicon; -use OCP\Config\Lexicon\Strictness; -use OCP\Config\ValueType; - -/** - * ConfigLexicon for 'core' app/user configs - */ -class CoreConfigLexicon implements ILexicon { - public function getStrictness(): Strictness { - return Strictness::IGNORE; - } - - /** - * @inheritDoc - * @return Entry[] - */ - public function getAppConfigs(): array { - return [ - new Entry('lastcron', ValueType::INT, 0, 'timestamp of last cron execution'), - ]; - } - - /** - * @inheritDoc - * @return Entry[] - */ - public function getUserConfigs(): array { - return [ - new Entry('lang', ValueType::STRING, null, 'language'), - ]; - } -} |