iappconfig.php 2.77 KB
Newer Older
1
2
<?php
/**
3
4
5
6
 * Copyright (c) 2014 Robin Appelman <icewind@owncloud.com>
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 * See the COPYING-README file.
7
8
9
10
11
12
 */
namespace OCP;

/**
 * This class provides an easy way for apps to store config values in the
 * database.
13
14
15
16
 *
 * @deprecated This interface will be dropped with ownCloud 10.1 which will be
 *             released in the first quarter of 2017. Use the methods of
 *             \OCP\IConfig instead
17
18
19
 */
interface IAppConfig {
	/**
20
	 * check if a key is set in the appconfig
21
22
23
	 * @param string $app
	 * @param string $key
	 * @return bool
24
	 * @deprecated use method hasAppKey of \OCP\IConfig
25
26
27
28
	 */
	public function hasKey($app, $key);

	/**
29
	 * Gets the config value
30
31
32
33
	 * @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
34
	 * @deprecated use method getAppValue of \OCP\IConfig
35
36
37
38
39
40
41
	 *
	 * 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);

	/**
42
	 * Deletes a key
43
44
45
	 * @param string $app app
	 * @param string $key key
	 * @return bool
46
	 * @deprecated use method deleteAppValue of \OCP\IConfig
47
48
49
50
	 */
	public function deleteKey($app, $key);

	/**
51
	 * Get the available keys for an app
52
	 * @param string $app the app we are looking for
53
	 * @return array an array of key names
54
	 * @deprecated use method getAppKeys of \OCP\IConfig
55
56
57
58
59
60
61
62
63
	 *
	 * 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
	 *
64
65
	 * @param string|false $key
	 * @param string|false $app
66
	 * @return array|false
67
	 * @deprecated use method getAppValuesByApp or getAppValuesByKey of \OCP\IConfig
68
69
70
71
	 */
	public function getValues($app, $key);

	/**
72
	 * sets a value in the appconfig
73
74
75
	 * @param string $app app
	 * @param string $key key
	 * @param string $value value
76
	 * @deprecated use method setAppValue of \OCP\IConfig
77
78
	 *
	 * Sets a value. If the key did not exist before it will be created.
79
	 * @return void
80
81
82
83
	 */
	public function setValue($app, $key, $value);

	/**
84
	 * Get all apps using the config
85
	 * @return array an array of app ids
86
	 * @deprecated use method getApps of \OCP\IConfig
87
88
89
90
91
92
93
	 *
	 * This function returns a list of all apps that have at least one
	 * entry in the appconfig table.
	 */
	public function getApps();

	/**
94
	 * Remove app from appconfig
95
96
	 * @param string $app app
	 * @return bool
97
	 * @deprecated use method deleteAppValue of \OCP\IConfig
98
99
100
101
102
	 *
	 * Removes all keys in appconfig belonging to the app.
	 */
	public function deleteApp($app);
}