]> git.mxchange.org Git - friendica.git/blob - src/Core/Config/Cache/IPConfigCache.php
Merge pull request #6704 from tobiasd/20190220-credits
[friendica.git] / src / Core / Config / Cache / IPConfigCache.php
1 <?php
2
3 namespace Friendica\Core\Config\Cache;
4
5 /**
6  * The interface for a user-specific config cache
7  */
8 interface IPConfigCache
9 {
10         /**
11          * Tries to load the specified configuration array into the user specific config array.
12          * Doesn't overwrite previously set values by default to prevent default config files to supersede DB Config.
13          *
14          * @param int   $uid
15          * @param array $config
16          */
17         function loadP($uid, array $config);
18
19         /**
20          * Retrieves a value from the user config cache
21          *
22          * @param int    $uid     User Id
23          * @param string $cat     Config category
24          * @param string $key     Config key
25          *
26          * @return null|string The value of the config entry or null if not set
27          */
28         function getP($uid, $cat, $key = null);
29
30         /**
31          * Sets a value in the user config cache
32          *
33          * Accepts raw output from the pconfig table
34          *
35          * @param int    $uid   User Id
36          * @param string $cat   Config category
37          * @param string $key   Config key
38          * @param mixed  $value Value to set
39          */
40         function setP($uid, $cat, $key, $value);
41
42         /**
43          * Deletes a value from the user config cache
44          *
45          * @param int    $uid User Id
46          * @param string $cat Config category
47          * @param string $key Config key
48          *
49          * @return bool true, if deleted
50          */
51         function deleteP($uid, $cat, $key);
52
53         /**
54          * Returns the whole configuration cache
55          *
56          * @return array
57          */
58         function getAll();
59 }