diff options
Diffstat (limited to 'lib/public/IAppConfig.php')
-rw-r--r-- | lib/public/IAppConfig.php | 84 |
1 files changed, 58 insertions, 26 deletions
diff --git a/lib/public/IAppConfig.php b/lib/public/IAppConfig.php index 10fc7c90650..d9e3e0d95a7 100644 --- a/lib/public/IAppConfig.php +++ b/lib/public/IAppConfig.php @@ -2,33 +2,13 @@ declare(strict_types=1); /** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Bart Visscher <bartv@thisnet.nl> - * @author Joas Schilling <coding@schilljs.com> - * @author Maxence Lange <maxence@artificial-owl.com> - * @author Morris Jobke <hey@morrisjobke.de> - * @author Robin Appelman <robin@icewind.nl> - * @author Robin McCorkell <robin@mccorkell.me.uk> - * @author Roeland Jago Douma <roeland@famdouma.nl> - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * + * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors + * SPDX-FileCopyrightText: 2016 ownCloud, Inc. + * SPDX-License-Identifier: AGPL-3.0-only */ namespace OCP; +use OCP\Config\ValueType; use OCP\Exceptions\AppConfigUnknownKeyException; /** @@ -66,12 +46,15 @@ interface IAppConfig { /** @since 29.0.0 */ public const VALUE_ARRAY = 64; + /** @since 31.0.0 */ + public const FLAG_SENSITIVE = 1; // value is sensitive + /** * Get list of all apps that have at least one config value stored in database * * **WARNING:** ignore lazy filtering, all config values are loaded from database * - * @return string[] list of app ids + * @return list<string> list of app ids * @since 7.0.0 */ public function getApps(): array; @@ -83,13 +66,27 @@ interface IAppConfig { * **WARNING:** ignore lazy filtering, all config values are loaded from database * * @param string $app id of the app + * @return list<string> list of stored config keys + * @see searchKeys to avoid loading lazy config keys * - * @return string[] list of stored config keys * @since 29.0.0 */ public function getKeys(string $app): array; /** + * Returns list of keys stored in database, related to an app. + * Please note that the values are not returned. + * + * @param string $app id of the app + * @param string $prefix returns only keys starting with this value + * @param bool $lazy TRUE to search in lazy config keys + * + * @return list<string> list of stored config keys + * @since 32.0.0 + */ + public function searchKeys(string $app, string $prefix = '', bool $lazy = false): array; + + /** * Check if a key exists in the list of stored config values. * * @param string $app id of the app @@ -454,6 +451,33 @@ interface IAppConfig { public function getDetails(string $app, string $key): array; /** + * returns an array containing details about a config key. + * key/value pair are available only if it exists. + * + * ``` + * [ + * "app" => "myapp", + * "key" => "mykey", + * "value" => "current_value", + * "default" => "default_if_available", + * "definition" => "this is what it does", + * "note" => "enabling this is not compatible with that", + * "lazy" => false, + * "type" => 4, + * "typeString" => "string", + * 'sensitive' => false + * ] + * ``` + * + * @param string $app id of the app + * @param string $key config key + * + * @return array{app: string, key: string, lazy?: bool, valueType?: ValueType, valueTypeName?: string, sensitive?: bool, default?: string, definition?: string, note?: string} + * @since 32.0.0 + */ + public function getKeyDetails(string $app, string $key): array; + + /** * Convert string like 'string', 'integer', 'float', 'bool' or 'array' to * to bitflag {@see VALUE_STRING}, {@see VALUE_INT}, {@see VALUE_FLOAT}, * {@see VALUE_BOOL} and {@see VALUE_ARRAY} @@ -525,4 +549,12 @@ interface IAppConfig { * @deprecated 29.0.0 Use {@see getAllValues()} or {@see searchValues()} */ public function getFilteredValues($app); + + /** + * Returns the installed version of all apps + * + * @return array<string, string> + * @since 32.0.0 + */ + public function getAppInstalledVersions(bool $onlyEnabled = false): array; } |