aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/IConfig.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/public/IConfig.php')
-rw-r--r--lib/public/IConfig.php65
1 files changed, 29 insertions, 36 deletions
diff --git a/lib/public/IConfig.php b/lib/public/IConfig.php
index 59993d27f79..3bc64c5e133 100644
--- a/lib/public/IConfig.php
+++ b/lib/public/IConfig.php
@@ -1,46 +1,17 @@
<?php
-/**
- * @copyright Copyright (c) 2016, ownCloud, Inc.
- *
- * @author Bart Visscher <bartv@thisnet.nl>
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Joas Schilling <coding@schilljs.com>
- * @author Jörn Friedrich Dreyer <jfd@butonic.de>
- * @author Lukas Reschke <lukas@statuscode.ch>
- * @author Morris Jobke <hey@morrisjobke.de>
- * @author Robin Appelman <robin@icewind.nl>
- * @author Roeland Jago Douma <roeland@famdouma.nl>
- * @author Thomas Müller <thomas.mueller@tmit.eu>
- *
- * @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/>
- *
- */
/**
- * Public interface of ownCloud for apps to use.
- * Config interface
- *
+ * SPDX-FileCopyrightText: 2016-2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
+ * SPDX-License-Identifier: AGPL-3.0-only
*/
-
// use OCP namespace for all classes that are considered public.
-// This means that they should be used by apps instead of the internal ownCloud classes
+// This means that they should be used by apps instead of the internal Nextcloud classes
namespace OCP;
/**
- * Access to all the configuration options ownCloud offers
+ * Access to all the configuration options Nextcloud offers.
* @since 6.0.0
*/
interface IConfig {
@@ -54,6 +25,7 @@ interface IConfig {
*
* @param array $configs Associative array with `key => value` pairs
* If value is null, the config key will be deleted
+ * @throws HintException if config file is read-only
* @since 8.0.0
*/
public function setSystemValues(array $configs);
@@ -63,6 +35,7 @@ interface IConfig {
*
* @param string $key the key of the value, under which will be saved
* @param mixed $value the value that should be stored
+ * @throws HintException if config file is read-only
* @since 8.0.0
*/
public function setSystemValue($key, $value);
@@ -131,6 +104,7 @@ interface IConfig {
* @param string $appName the appName that we stored the value under
* @return string[] the keys stored for the app
* @since 8.0.0
+ * @deprecated 29.0.0 Use {@see IAppConfig} directly
*/
public function getAppKeys($appName);
@@ -142,6 +116,7 @@ interface IConfig {
* @param string $value the value that should be stored
* @return void
* @since 6.0.0
+ * @deprecated 29.0.0 Use {@see IAppConfig} directly
*/
public function setAppValue($appName, $key, $value);
@@ -151,8 +126,10 @@ interface IConfig {
* @param string $appName the appName that we stored the value under
* @param string $key the key of the value, under which it was saved
* @param string $default the default value to be returned if the value isn't set
+ *
* @return string the saved value
* @since 6.0.0 - parameter $default was added in 7.0.0
+ * @deprecated 29.0.0 Use {@see IAppConfig} directly
*/
public function getAppValue($appName, $key, $default = '');
@@ -162,6 +139,7 @@ interface IConfig {
* @param string $appName the appName that we stored the value under
* @param string $key the key of the value, under which it was saved
* @since 8.0.0
+ * @deprecated 29.0.0 Use {@see IAppConfig} directly
*/
public function deleteAppValue($appName, $key);
@@ -170,6 +148,7 @@ interface IConfig {
*
* @param string $appName the appName the configs are stored under
* @since 8.0.0
+ * @deprecated 29.0.0 Use {@see IAppConfig} directly
*/
public function deleteAppValues($appName);
@@ -191,7 +170,7 @@ interface IConfig {
/**
* Shortcut for getting a user defined value
*
- * @param string $userId the userId of the user that we want to store the value under
+ * @param ?string $userId the userId of the user that we want to store the value under
* @param string $appName the appName that we stored the value under
* @param string $key the key under which the value is being stored
* @param mixed $default the default value to be returned if the value isn't set
@@ -222,6 +201,19 @@ interface IConfig {
public function getUserKeys($userId, $appName);
/**
+ * Get all user configs sorted by app of one user
+ *
+ * @param string $userId the userId of the user that we want to get all values from
+ * @psalm-return array<string, array<string, string>>
+ * @return array[] - 2 dimensional array with the following structure:
+ * [ $appId =>
+ * [ $key => $value ]
+ * ]
+ * @since 24.0.0
+ */
+ public function getAllUserValues(string $userId): array;
+
+ /**
* Delete a user value
*
* @param string $userId the userId of the user that we want to store the value under
@@ -253,7 +245,8 @@ interface IConfig {
* @param string $appName the app to get the user for
* @param string $key the key to get the user for
* @param string $value the value to get the user for
- * @return array of user IDs
+ * @return list<string> of user IDs
+ * @since 31.0.0 return type of `list<string>`
* @since 8.0.0
*/
public function getUsersForUserValue($appName, $key, $value);