Friendica Communications Platform (please note that this is a clone of the repository at github, issues are handled there)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IPConfigAdapter.php 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. <?php
  2. /*
  3. * To change this license header, choose License Headers in Project Properties.
  4. * To change this template file, choose Tools | Templates
  5. * and open the template in the editor.
  6. */
  7. namespace Friendica\Core\Config\Adapter;
  8. /**
  9. *
  10. * @author benlo
  11. */
  12. interface IPConfigAdapter
  13. {
  14. /**
  15. * Loads all configuration values of a user's config family into a cached storage.
  16. *
  17. * @param string $uid The user_id
  18. * @param string $cat The category of the configuration value
  19. *
  20. * @return array
  21. */
  22. public function load($uid, $cat);
  23. /**
  24. * Get a particular user's config variable given the category name
  25. * ($family) and a key.
  26. *
  27. * @param string $uid The user_id
  28. * @param string $cat The category of the configuration value
  29. * @param string $key The configuration key to query
  30. *
  31. * @return mixed Stored value or "!<unset>!" if it does not exist
  32. */
  33. public function get($uid, $cat, $key);
  34. /**
  35. * Stores a config value ($value) in the category ($family) under the key ($key)
  36. * for the user_id $uid.
  37. *
  38. * @note Please do not store booleans - convert to 0/1 integer values!
  39. *
  40. * @param string $uid The user_id
  41. * @param string $cat The category of the configuration value
  42. * @param string $key The configuration key to set
  43. * @param string $value The value to store
  44. *
  45. * @return bool Operation success
  46. */
  47. public function set($uid, $cat, $key, $value);
  48. /**
  49. * Removes the configured value from the stored cache
  50. * and removes it from the database.
  51. *
  52. * @param string $uid The user_id
  53. * @param string $cat The category of the configuration value
  54. * @param string $key The configuration key to delete
  55. *
  56. * @return bool
  57. */
  58. public function delete($uid, $cat, $key);
  59. /**
  60. * Checks, if the current adapter is connected to the backend
  61. *
  62. * @return bool
  63. */
  64. public function isConnected();
  65. }