aboutsummaryrefslogtreecommitdiffstats
path: root/lib/unstable/Config/Lexicon
diff options
context:
space:
mode:
Diffstat (limited to 'lib/unstable/Config/Lexicon')
-rw-r--r--lib/unstable/Config/Lexicon/ConfigLexiconEntry.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/unstable/Config/Lexicon/ConfigLexiconEntry.php b/lib/unstable/Config/Lexicon/ConfigLexiconEntry.php
index d7d781d8e26..d0d9b4cbd23 100644
--- a/lib/unstable/Config/Lexicon/ConfigLexiconEntry.php
+++ b/lib/unstable/Config/Lexicon/ConfigLexiconEntry.php
@@ -17,6 +17,9 @@ use NCU\Config\ValueType;
* @experimental 31.0.0
*/
class ConfigLexiconEntry {
+ /** @experimental 32.0.0 */
+ public const RENAME_INVERT_BOOLEAN = 1;
+
private string $definition = '';
private ?string $default = null;
@@ -26,6 +29,7 @@ class ConfigLexiconEntry {
* @param string $definition optional description of config key available when using occ command
* @param bool $lazy set config value as lazy
* @param int $flags set flags
+ * @param string|null $rename previous config key to migrate config value from
* @param bool $deprecated set config key as deprecated
*
* @experimental 31.0.0
@@ -40,6 +44,8 @@ class ConfigLexiconEntry {
private readonly bool $lazy = false,
private readonly int $flags = 0,
private readonly bool $deprecated = false,
+ private readonly ?string $rename = null,
+ private readonly int $options = 0,
) {
/** @psalm-suppress UndefinedClass */
if (\OC::$CLI) { // only store definition if ran from CLI
@@ -199,6 +205,25 @@ class ConfigLexiconEntry {
}
/**
+ * should be called/used only during migration/upgrade.
+ * link to an old config key.
+ *
+ * @return string|null not NULL if value can be imported from a previous key
+ * @experimental 32.0.0
+ */
+ public function getRename(): ?string {
+ return $this->rename;
+ }
+
+ /**
+ * @experimental 32.0.0
+ * @return bool TRUE if $option was set during the creation of the entry.
+ */
+ public function hasOption(int $option): bool {
+ return (($option & $this->options) !== 0);
+ }
+
+ /**
* returns if config key is set as deprecated
*
* @return bool TRUE if config si deprecated