iappconfig.php 3.15 KB
Newer Older
1
2
<?php
/**
Jenkins for ownCloud's avatar
Jenkins for ownCloud committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
 * @author Bart Visscher <bartv@thisnet.nl>
 * @author Morris Jobke <hey@morrisjobke.de>
 * @author Robin Appelman <icewind@owncloud.com>
 * @author Robin McCorkell <rmccorkell@karoshi.org.uk>
 * @author Scrutinizer Auto-Fixer <auto-fixer@scrutinizer-ci.com>
 *
 * @copyright Copyright (c) 2015, ownCloud, Inc.
 * @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/>
 *
24
25
26
27
28
29
30
31
32
 */
namespace OCP;

/**
 * This class provides an easy way for apps to store config values in the
 * database.
 */
interface IAppConfig {
	/**
33
	 * check if a key is set in the appconfig
34
35
36
37
38
39
40
	 * @param string $app
	 * @param string $key
	 * @return bool
	 */
	public function hasKey($app, $key);

	/**
41
	 * Gets the config value
42
43
44
45
	 * @param string $app app
	 * @param string $key key
	 * @param string $default = null, default value if the key does not exist
	 * @return string the value or $default
46
	 * @deprecated use method getAppValue of \OCP\IConfig
47
48
49
50
51
52
53
	 *
	 * This function gets a value from the appconfig table. If the key does
	 * not exist the default value will be returned
	 */
	public function getValue($app, $key, $default = null);

	/**
54
	 * Deletes a key
55
56
57
	 * @param string $app app
	 * @param string $key key
	 * @return bool
58
	 * @deprecated use method deleteAppValue of \OCP\IConfig
59
60
61
62
	 */
	public function deleteKey($app, $key);

	/**
63
	 * Get the available keys for an app
64
	 * @param string $app the app we are looking for
65
	 * @return array an array of key names
66
	 * @deprecated use method getAppKeys of \OCP\IConfig
67
68
69
70
71
72
73
74
75
	 *
	 * This function gets all keys of an app. Please note that the values are
	 * not returned.
	 */
	public function getKeys($app);

	/**
	 * get multiply values, either the app or key can be used as wildcard by setting it to false
	 *
76
77
	 * @param string|false $key
	 * @param string|false $app
78
	 * @return array|false
79
80
81
82
	 */
	public function getValues($app, $key);

	/**
83
	 * sets a value in the appconfig
84
85
86
	 * @param string $app app
	 * @param string $key key
	 * @param string $value value
87
	 * @deprecated use method setAppValue of \OCP\IConfig
88
89
	 *
	 * Sets a value. If the key did not exist before it will be created.
90
	 * @return void
91
92
93
94
	 */
	public function setValue($app, $key, $value);

	/**
95
	 * Get all apps using the config
96
	 * @return array an array of app ids
97
98
99
100
101
102
103
	 *
	 * This function returns a list of all apps that have at least one
	 * entry in the appconfig table.
	 */
	public function getApps();

	/**
104
	 * Remove app from appconfig
105
106
	 * @param string $app app
	 * @return bool
107
	 * @deprecated use method deleteAppValue of \OCP\IConfig
108
109
110
111
112
	 *
	 * Removes all keys in appconfig belonging to the app.
	 */
	public function deleteApp($app);
}