Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions apps/files_external/lib/ConfigLexicon.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,30 +8,30 @@

namespace OCA\Files_External;

use NCU\Config\Lexicon\ConfigLexiconEntry;
use NCU\Config\Lexicon\ConfigLexiconStrictness;
use NCU\Config\Lexicon\IConfigLexicon;
use NCU\Config\ValueType;
use OCP\Config\Lexicon\Entry;
use OCP\Config\Lexicon\ILexicon;
use OCP\Config\Lexicon\Strictness;
use OCP\Config\ValueType;

/**
* Config Lexicon for files_sharing.
*
* Please Add & Manage your Config Keys in that file and keep the Lexicon up to date!
*
* {@see IConfigLexicon}
* {@see ILexicon}
*/
class ConfigLexicon implements IConfigLexicon {
class ConfigLexicon implements ILexicon {
public const ALLOW_USER_MOUNTING = 'allow_user_mounting';
public const USER_MOUNTING_BACKENDS = 'user_mounting_backends';

public function getStrictness(): ConfigLexiconStrictness {
return ConfigLexiconStrictness::NOTICE;
public function getStrictness(): Strictness {
return Strictness::NOTICE;
}

public function getAppConfigs(): array {
return [
new ConfigLexiconEntry(self::ALLOW_USER_MOUNTING, ValueType::BOOL, false, 'allow users to mount their own external filesystems', true),
new ConfigLexiconEntry(self::USER_MOUNTING_BACKENDS, ValueType::STRING, '', 'list of mounting backends available for users', true),
new Entry(self::ALLOW_USER_MOUNTING, ValueType::BOOL, false, 'allow users to mount their own external filesystems', true),
new Entry(self::USER_MOUNTING_BACKENDS, ValueType::STRING, '', 'list of mounting backends available for users', true),
];
}

Expand Down
18 changes: 9 additions & 9 deletions apps/files_sharing/lib/Config/ConfigLexicon.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@

namespace OCA\Files_Sharing\Config;

use NCU\Config\Lexicon\ConfigLexiconEntry;
use NCU\Config\Lexicon\ConfigLexiconStrictness;
use NCU\Config\Lexicon\IConfigLexicon;
use NCU\Config\ValueType;
use OCP\Config\Lexicon\Entry;
use OCP\Config\Lexicon\ILexicon;
use OCP\Config\Lexicon\Strictness;
use OCP\Config\ValueType;

/**
* Config Lexicon for files_sharing.
*
* Please Add & Manage your Config Keys in that file and keep the Lexicon up to date!
*
* {@see IConfigLexicon}
* {@see ILexicon}
*/
class ConfigLexicon implements IConfigLexicon {
class ConfigLexicon implements ILexicon {
public const SHOW_FEDERATED_AS_INTERNAL = 'show_federated_shares_as_internal';

public function getStrictness(): ConfigLexiconStrictness {
return ConfigLexiconStrictness::IGNORE;
public function getStrictness(): Strictness {
return Strictness::IGNORE;
}

public function getAppConfigs(): array {
return [
new ConfigLexiconEntry(self::SHOW_FEDERATED_AS_INTERNAL, ValueType::BOOL, false, 'shows federated shares as internal shares', true),
new Entry(self::SHOW_FEDERATED_AS_INTERNAL, ValueType::BOOL, false, 'shows federated shares as internal shares', true),
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@

namespace OCA\Theming\Tests\Migration;

use NCU\Config\IUserConfig;
use OCA\Theming\Migration\Version2006Date20240905111627;
use OCP\BackgroundJob\IJobList;
use OCP\Config\IUserConfig;
use OCP\IAppConfig;
use OCP\IDBConnection;
use OCP\IUserManager;
Expand Down
18 changes: 9 additions & 9 deletions core/AppInfo/ConfigLexicon.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,31 @@

namespace OC\Core\AppInfo;

use NCU\Config\Lexicon\ConfigLexiconEntry;
use NCU\Config\Lexicon\ConfigLexiconStrictness;
use NCU\Config\Lexicon\IConfigLexicon;
use NCU\Config\ValueType;
use OCP\Config\Lexicon\Entry;
use OCP\Config\Lexicon\ILexicon;
use OCP\Config\Lexicon\Strictness;
use OCP\Config\ValueType;

/**
* Config Lexicon for core.
*
* Please Add & Manage your Config Keys in that file and keep the Lexicon up to date!
*/
class ConfigLexicon implements IConfigLexicon {
class ConfigLexicon implements ILexicon {
public const SHAREAPI_ALLOW_FEDERATION_ON_PUBLIC_SHARES = 'shareapi_allow_federation_on_public_shares';

public function getStrictness(): ConfigLexiconStrictness {
return ConfigLexiconStrictness::IGNORE;
public function getStrictness(): Strictness {
return Strictness::IGNORE;
}

public function getAppConfigs(): array {
return [
new ConfigLexiconEntry(
new Entry(
key: self::SHAREAPI_ALLOW_FEDERATION_ON_PUBLIC_SHARES,
type: ValueType::BOOL,
lazy: true,
defaultRaw: true,
definition: 'adds share permission to public shares to allow adding them to your Nextcloud (federation)',
lazy: true,
),
];
}
Expand Down
2 changes: 1 addition & 1 deletion core/Command/Config/Preset.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
*/
namespace OC\Core\Command\Config;

use NCU\Config\Lexicon\Preset as ConfigLexiconPreset;
use OC\Config\ConfigManager;
use OC\Core\Command\Base;
use OCP\Config\Lexicon\Preset as ConfigLexiconPreset;
use OCP\IConfig;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand Down
9 changes: 9 additions & 0 deletions lib/composer/composer/autoload_classmap.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,15 @@
'OCP\\Common\\Exception\\NotFoundException' => $baseDir . '/lib/public/Common/Exception/NotFoundException.php',
'OCP\\Config\\BeforePreferenceDeletedEvent' => $baseDir . '/lib/public/Config/BeforePreferenceDeletedEvent.php',
'OCP\\Config\\BeforePreferenceSetEvent' => $baseDir . '/lib/public/Config/BeforePreferenceSetEvent.php',
'OCP\\Config\\Exceptions\\IncorrectTypeException' => $baseDir . '/lib/public/Config/Exceptions/IncorrectTypeException.php',
'OCP\\Config\\Exceptions\\TypeConflictException' => $baseDir . '/lib/public/Config/Exceptions/TypeConflictException.php',
'OCP\\Config\\Exceptions\\UnknownKeyException' => $baseDir . '/lib/public/Config/Exceptions/UnknownKeyException.php',
'OCP\\Config\\IUserConfig' => $baseDir . '/lib/public/Config/IUserConfig.php',
'OCP\\Config\\Lexicon\\Entry' => $baseDir . '/lib/public/Config/Lexicon/Entry.php',
'OCP\\Config\\Lexicon\\ILexicon' => $baseDir . '/lib/public/Config/Lexicon/ILexicon.php',
'OCP\\Config\\Lexicon\\Preset' => $baseDir . '/lib/public/Config/Lexicon/Preset.php',
'OCP\\Config\\Lexicon\\Strictness' => $baseDir . '/lib/public/Config/Lexicon/Strictness.php',
'OCP\\Config\\ValueType' => $baseDir . '/lib/public/Config/ValueType.php',
'OCP\\Console\\ConsoleEvent' => $baseDir . '/lib/public/Console/ConsoleEvent.php',
'OCP\\Console\\ReservedOptions' => $baseDir . '/lib/public/Console/ReservedOptions.php',
'OCP\\Constants' => $baseDir . '/lib/public/Constants.php',
Expand Down
9 changes: 9 additions & 0 deletions lib/composer/composer/autoload_static.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,15 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
'OCP\\Common\\Exception\\NotFoundException' => __DIR__ . '/../../..' . '/lib/public/Common/Exception/NotFoundException.php',
'OCP\\Config\\BeforePreferenceDeletedEvent' => __DIR__ . '/../../..' . '/lib/public/Config/BeforePreferenceDeletedEvent.php',
'OCP\\Config\\BeforePreferenceSetEvent' => __DIR__ . '/../../..' . '/lib/public/Config/BeforePreferenceSetEvent.php',
'OCP\\Config\\Exceptions\\IncorrectTypeException' => __DIR__ . '/../../..' . '/lib/public/Config/Exceptions/IncorrectTypeException.php',
'OCP\\Config\\Exceptions\\TypeConflictException' => __DIR__ . '/../../..' . '/lib/public/Config/Exceptions/TypeConflictException.php',
'OCP\\Config\\Exceptions\\UnknownKeyException' => __DIR__ . '/../../..' . '/lib/public/Config/Exceptions/UnknownKeyException.php',
'OCP\\Config\\IUserConfig' => __DIR__ . '/../../..' . '/lib/public/Config/IUserConfig.php',
'OCP\\Config\\Lexicon\\Entry' => __DIR__ . '/../../..' . '/lib/public/Config/Lexicon/Entry.php',
'OCP\\Config\\Lexicon\\ILexicon' => __DIR__ . '/../../..' . '/lib/public/Config/Lexicon/ILexicon.php',
'OCP\\Config\\Lexicon\\Preset' => __DIR__ . '/../../..' . '/lib/public/Config/Lexicon/Preset.php',
'OCP\\Config\\Lexicon\\Strictness' => __DIR__ . '/../../..' . '/lib/public/Config/Lexicon/Strictness.php',
'OCP\\Config\\ValueType' => __DIR__ . '/../../..' . '/lib/public/Config/ValueType.php',
'OCP\\Console\\ConsoleEvent' => __DIR__ . '/../../..' . '/lib/public/Console/ConsoleEvent.php',
'OCP\\Console\\ReservedOptions' => __DIR__ . '/../../..' . '/lib/public/Console/ReservedOptions.php',
'OCP\\Constants' => __DIR__ . '/../../..' . '/lib/public/Constants.php',
Expand Down
5 changes: 2 additions & 3 deletions lib/composer/composer/platform_check.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL;
}
}
trigger_error(
'Composer detected issues in your platform: ' . implode(' ', $issues),
E_USER_ERROR
throw new \RuntimeException(
'Composer detected issues in your platform: ' . implode(' ', $issues)
);
}
6 changes: 3 additions & 3 deletions lib/private/AllConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
*/
namespace OC;

use NCU\Config\Exceptions\TypeConflictException;
use NCU\Config\IUserConfig;
use NCU\Config\ValueType;
use OC\Config\UserConfig;
use OCP\Cache\CappedMemoryCache;
use OCP\Config\Exceptions\TypeConflictException;
use OCP\Config\IUserConfig;
use OCP\Config\ValueType;
use OCP\IConfig;
use OCP\IDBConnection;
use OCP\PreConditionNotMetException;
Expand Down
30 changes: 15 additions & 15 deletions lib/private/AppConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

use InvalidArgumentException;
use JsonException;
use NCU\Config\Lexicon\ConfigLexiconEntry;
use NCU\Config\Lexicon\ConfigLexiconStrictness;
use NCU\Config\Lexicon\IConfigLexicon;
use NCU\Config\Lexicon\Preset;
use OC\AppFramework\Bootstrap\Coordinator;
use OC\Config\ConfigManager;
use OCP\Config\Lexicon\Entry;
use OCP\Config\Lexicon\ILexicon;
use OCP\Config\Lexicon\Preset;
use OCP\Config\Lexicon\Strictness;
use OCP\DB\Exception as DBException;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\Exceptions\AppConfigIncorrectTypeException;
Expand Down Expand Up @@ -62,7 +62,7 @@ class AppConfig implements IAppConfig {
private array $valueTypes = []; // type for all config values
private bool $fastLoaded = false;
private bool $lazyLoaded = false;
/** @var array<string, array{entries: array<string, ConfigLexiconEntry>, aliases: array<string, string>, strictness: ConfigLexiconStrictness}> ['app_id' => ['strictness' => ConfigLexiconStrictness, 'entries' => ['config_key' => ConfigLexiconEntry[]]] */
/** @var array<string, array{entries: array<string, Entry>, aliases: array<string, string>, strictness: Strictness}> ['app_id' => ['strictness' => ConfigLexiconStrictness, 'entries' => ['config_key' => ConfigLexiconEntry[]]] */
private array $configLexiconDetails = [];
private bool $ignoreLexiconAliases = false;
private ?Preset $configLexiconPreset = null;
Expand Down Expand Up @@ -1655,7 +1655,7 @@ private function matchAndApplyLexiconDefinition(
return true;
}

/** @var ConfigLexiconEntry $configValue */
/** @var Entry $configValue */
$configValue = $configDetails['entries'][$key];
$type &= ~self::VALUE_SENSITIVE;

Expand Down Expand Up @@ -1685,28 +1685,28 @@ private function matchAndApplyLexiconDefinition(
/**
* manage ConfigLexicon behavior based on strictness set in IConfigLexicon
*
* @param ConfigLexiconStrictness|null $strictness
* @param Strictness|null $strictness
* @param string $line
*
* @return bool TRUE if conflict can be fully ignored, FALSE if action should be not performed
* @throws AppConfigUnknownKeyException if strictness implies exception
* @see IConfigLexicon::getStrictness()
* @see ILexicon::getStrictness()
*/
private function applyLexiconStrictness(
?ConfigLexiconStrictness $strictness,
?Strictness $strictness,
string $line = '',
): bool {
if ($strictness === null) {
return true;
}

switch ($strictness) {
case ConfigLexiconStrictness::IGNORE:
case Strictness::IGNORE:
return true;
case ConfigLexiconStrictness::NOTICE:
case Strictness::NOTICE:
$this->logger->notice($line);
return true;
case ConfigLexiconStrictness::WARNING:
case Strictness::WARNING:
$this->logger->warning($line);
return false;
}
Expand All @@ -1720,7 +1720,7 @@ private function applyLexiconStrictness(
* @param string $appId
* @internal
*
* @return array{entries: array<string, ConfigLexiconEntry>, aliases: array<string, string>, strictness: ConfigLexiconStrictness}
* @return array{entries: array<string, Entry>, aliases: array<string, string>, strictness: Strictness}
*/
public function getConfigDetailsFromLexicon(string $appId): array {
if (!array_key_exists($appId, $this->configLexiconDetails)) {
Expand All @@ -1737,14 +1737,14 @@ public function getConfigDetailsFromLexicon(string $appId): array {
$this->configLexiconDetails[$appId] = [
'entries' => $entries,
'aliases' => $aliases,
'strictness' => $configLexicon?->getStrictness() ?? ConfigLexiconStrictness::IGNORE
'strictness' => $configLexicon?->getStrictness() ?? Strictness::IGNORE
];
}

return $this->configLexiconDetails[$appId];
}

private function getLexiconEntry(string $appId, string $key): ?ConfigLexiconEntry {
private function getLexiconEntry(string $appId, string $key): ?Entry {
return $this->getConfigDetailsFromLexicon($appId)['entries'][$key] ?? null;
}

Expand Down
8 changes: 4 additions & 4 deletions lib/private/AppFramework/Bootstrap/RegistrationContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
namespace OC\AppFramework\Bootstrap;

use Closure;
use NCU\Config\Lexicon\IConfigLexicon;
use OC\Config\Lexicon\CoreConfigLexicon;
use OC\Support\CrashReport\Registry;
use OCP\AppFramework\App;
Expand All @@ -23,6 +22,7 @@
use OCP\Calendar\Room\IBackend as IRoomBackend;
use OCP\Capabilities\ICapability;
use OCP\Collaboration\Reference\IReferenceProvider;
use OCP\Config\Lexicon\ILexicon;
use OCP\Dashboard\IManager;
use OCP\Dashboard\IWidget;
use OCP\EventDispatcher\IEventDispatcher;
Expand Down Expand Up @@ -652,7 +652,7 @@ public function registerMailProvider(string $appId, string $class): void {
}

/**
* @psalm-param class-string<IConfigLexicon> $configLexiconClass
* @psalm-param class-string<ILexicon> $configLexiconClass
*/
public function registerConfigLexicon(string $appId, string $configLexiconClass): void {
$this->configLexiconClasses[$appId] = $configLexiconClass;
Expand Down Expand Up @@ -1023,9 +1023,9 @@ public function getMailProviders(): array {
*
* @param string $appId
*
* @return IConfigLexicon|null
* @return ILexicon|null
*/
public function getConfigLexicon(string $appId): ?IConfigLexicon {
public function getConfigLexicon(string $appId): ?ILexicon {
if (!array_key_exists($appId, $this->configLexiconClasses)) {
return null;
}
Expand Down
Loading
Loading