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.

73 lines
1.9 KiB

3 years ago
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Bart Visscher <bartv@thisnet.nl>
  6. * @author Joas Schilling <coding@schilljs.com>
  7. * @author Morris Jobke <hey@morrisjobke.de>
  8. * @author Robin Appelman <robin@icewind.nl>
  9. * @author Robin McCorkell <robin@mccorkell.me.uk>
  10. * @author Roeland Jago Douma <roeland@famdouma.nl>
  11. *
  12. * @license AGPL-3.0
  13. *
  14. * This code is free software: you can redistribute it and/or modify
  15. * it under the terms of the GNU Affero General Public License, version 3,
  16. * as published by the Free Software Foundation.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU Affero General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU Affero General Public License, version 3,
  24. * along with this program. If not, see <http://www.gnu.org/licenses/>
  25. *
  26. */
  27. namespace OCP;
  28. /**
  29. * This class provides an easy way for apps to store config values in the
  30. * database.
  31. * @since 7.0.0
  32. */
  33. interface IAppConfig {
  34. /**
  35. * check if a key is set in the appconfig
  36. * @param string $app
  37. * @param string $key
  38. * @return bool
  39. * @since 7.0.0
  40. */
  41. public function hasKey($app, $key);
  42. /**
  43. * get multiply values, either the app or key can be used as wildcard by setting it to false
  44. *
  45. * @param string|false $key
  46. * @param string|false $app
  47. * @return array|false
  48. * @since 7.0.0
  49. */
  50. public function getValues($app, $key);
  51. /**
  52. * get all values of the app or and filters out sensitive data
  53. *
  54. * @param string $app
  55. * @return array
  56. * @since 12.0.0
  57. */
  58. public function getFilteredValues($app);
  59. /**
  60. * Get all apps using the config
  61. * @return array an array of app ids
  62. *
  63. * This function returns a list of all apps that have at least one
  64. * entry in the appconfig table.
  65. * @since 7.0.0
  66. */
  67. public function getApps();
  68. }