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.

111 lines
3.4 KiB

3 years ago
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Bart Visscher <bartv@thisnet.nl>
  6. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  7. * @author Frank Karlitschek <frank@karlitschek.de>
  8. * @author Georg Ehrke <oc.list@georgehrke.com>
  9. * @author Joas Schilling <coding@schilljs.com>
  10. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  11. * @author Julius Härtl <jus@bitgrid.net>
  12. * @author Morris Jobke <hey@morrisjobke.de>
  13. * @author Robin McCorkell <robin@mccorkell.me.uk>
  14. * @author Roeland Jago Douma <roeland@famdouma.nl>
  15. * @author Thomas Müller <thomas.mueller@tmit.eu>
  16. *
  17. * @license AGPL-3.0
  18. *
  19. * This code is free software: you can redistribute it and/or modify
  20. * it under the terms of the GNU Affero General Public License, version 3,
  21. * as published by the Free Software Foundation.
  22. *
  23. * This program is distributed in the hope that it will be useful,
  24. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26. * GNU Affero General Public License for more details.
  27. *
  28. * You should have received a copy of the GNU Affero General Public License, version 3,
  29. * along with this program. If not, see <http://www.gnu.org/licenses/>
  30. *
  31. */
  32. /**
  33. * Public interface of ownCloud for apps to use.
  34. * App Class
  35. *
  36. */
  37. // use OCP namespace for all classes that are considered public.
  38. // This means that they should be used by apps instead of the internal ownCloud classes
  39. namespace OCP;
  40. /**
  41. * This class provides functions to manage apps in ownCloud
  42. * @since 4.0.0
  43. * @deprecated 14.0.0
  44. */
  45. class App {
  46. /**
  47. * Register a Configuration Screen that should appear in the personal settings section.
  48. * @param string $app appid
  49. * @param string $page page to be included
  50. * @return void
  51. * @since 4.0.0
  52. * @deprecated 14.0.0 Use settings section in appinfo.xml to register personal admin sections
  53. */
  54. public static function registerPersonal($app, $page) {
  55. \OC_App::registerPersonal($app, $page);
  56. }
  57. /**
  58. * Register a Configuration Screen that should appear in the Admin section.
  59. * @param string $app string appid
  60. * @param string $page string page to be included
  61. * @return void
  62. * @since 4.0.0
  63. * @deprecated 14.0.0 Use settings section in appinfo.xml to register admin sections
  64. */
  65. public static function registerAdmin($app, $page) {
  66. \OC_App::registerAdmin($app, $page);
  67. }
  68. /**
  69. * Read app metadata from the info.xml file
  70. * @param string $app id of the app or the path of the info.xml file
  71. * @param boolean $path (optional)
  72. * @return array|null
  73. * @deprecated 14.0.0 ise \OC::$server->getAppManager()->getAppInfo($appId)
  74. * @since 4.0.0
  75. */
  76. public static function getAppInfo($app, $path=false) {
  77. return \OC_App::getAppInfo($app, $path);
  78. }
  79. /**
  80. * checks whether or not an app is enabled
  81. * @param string $app
  82. * @return boolean
  83. *
  84. * This function checks whether or not an app is enabled.
  85. * @since 4.0.0
  86. * @deprecated 13.0.0 use \OC::$server->getAppManager()->isEnabledForUser($appId)
  87. */
  88. public static function isEnabled($app) {
  89. return \OC::$server->getAppManager()->isEnabledForUser($app);
  90. }
  91. /**
  92. * Get the last version of the app from appinfo/info.xml
  93. * @param string $app
  94. * @return string
  95. * @since 4.0.0
  96. * @deprecated 14.0.0 use \OC::$server->getAppManager()->getAppVersion($appId)
  97. */
  98. public static function getAppVersion($app) {
  99. return \OC::$server->getAppManager()->getAppVersion($app);
  100. }
  101. }