App.php 3.5 KB

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