]> git.mxchange.org Git - friendica.git/blob - src/Core/Config/Cache/IPConfigCache.php
Config FollowUp
[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 string The value of the config entry or '!<unset>!' 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         /**
55          * Checks if a value is set in the user config cache.
56          *
57          * @param int    $uid  User Id
58          * @param string $cat  Config category
59          * @param string $key  Config key
60          * @return bool
61          */
62         function hasP($uid, $cat, $key = null);
63
64         /**
65          * Returns the whole configuration cache
66          *
67          * @return array
68          */
69         function getAll();
70 }