IAppConfig.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. *
  11. * @license AGPL-3.0
  12. *
  13. * This code is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License, version 3,
  15. * as published by the Free Software Foundation.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU Affero General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU Affero General Public License, version 3,
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>
  24. *
  25. */
  26. namespace OCP;
  27. /**
  28. * This class provides an easy way for apps to store config values in the
  29. * database.
  30. * @since 7.0.0
  31. */
  32. interface IAppConfig {
  33. /**
  34. * check if a key is set in the appconfig
  35. * @param string $app
  36. * @param string $key
  37. * @return bool
  38. * @since 7.0.0
  39. */
  40. public function hasKey($app, $key);
  41. /**
  42. * get multiply values, either the app or key can be used as wildcard by setting it to false
  43. *
  44. * @param string|false $key
  45. * @param string|false $app
  46. * @return array|false
  47. * @since 7.0.0
  48. */
  49. public function getValues($app, $key);
  50. /**
  51. * get all values of the app or and filters out sensitive data
  52. *
  53. * @param string $app
  54. * @return array
  55. * @since 12.0.0
  56. */
  57. public function getFilteredValues($app);
  58. /**
  59. * Get all apps using the config
  60. * @return array an array of app ids
  61. *
  62. * This function returns a list of all apps that have at least one
  63. * entry in the appconfig table.
  64. * @since 7.0.0
  65. */
  66. public function getApps();
  67. }