allconfig.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. /**
  3. * Copyright (c) 2013 Bart Visscher <bartv@thisnet.nl>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. *
  8. */
  9. namespace OC;
  10. /**
  11. * Class to combine all the configuration options ownCloud offers
  12. */
  13. class AllConfig implements \OCP\IConfig {
  14. /**
  15. * Sets a new system wide value
  16. * @param string $key the key of the value, under which will be saved
  17. * @param string $value the value that should be stored
  18. * @todo need a use case for this
  19. */
  20. // public function setSystemValue($key, $value) {
  21. // \OCP\Config::setSystemValue($key, $value);
  22. // }
  23. /**
  24. * Looks up a system wide defined value
  25. * @param string $key the key of the value, under which it was saved
  26. * @return string the saved value
  27. */
  28. public function getSystemValue($key) {
  29. return \OCP\Config::getSystemValue($key, '');
  30. }
  31. /**
  32. * Writes a new app wide value
  33. * @param string $appName the appName that we want to store the value under
  34. * @param string $key the key of the value, under which will be saved
  35. * @param string $value the value that should be stored
  36. */
  37. public function setAppValue($appName, $key, $value) {
  38. \OCP\Config::setAppValue($appName, $key, $value);
  39. }
  40. /**
  41. * Looks up an app wide defined value
  42. * @param string $appName the appName that we stored the value under
  43. * @param string $key the key of the value, under which it was saved
  44. * @return string the saved value
  45. */
  46. public function getAppValue($appName, $key) {
  47. return \OCP\Config::getAppValue($appName, $key, '');
  48. }
  49. /**
  50. * Set a user defined value
  51. * @param string $userId the userId of the user that we want to store the value under
  52. * @param string $appName the appName that we want to store the value under
  53. * @param string $key the key under which the value is being stored
  54. * @param string $value the value that you want to store
  55. */
  56. public function setUserValue($userId, $appName, $key, $value) {
  57. \OCP\Config::setUserValue($userId, $appName, $key, $value);
  58. }
  59. /**
  60. * Shortcut for getting a user defined value
  61. * @param string $userId the userId of the user that we want to store the value under
  62. * @param string $appName the appName that we stored the value under
  63. * @param string $key the key under which the value is being stored
  64. */
  65. public function getUserValue($userId, $appName, $key){
  66. return \OCP\Config::getUserValue($userId, $appName, $key);
  67. }
  68. }