api.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <?php
  2. /**
  3. * ownCloud
  4. *
  5. * @author Tom Needham
  6. * @copyright 2012 Tom Needham tom@owncloud.com
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
  10. * License as published by the Free Software Foundation; either
  11. * version 3 of the License, or any later version.
  12. *
  13. * This library is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
  17. *
  18. * You should have received a copy of the GNU Affero General Public
  19. * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  20. *
  21. */
  22. /**
  23. * Public interface of ownCloud for apps to use.
  24. * API Class
  25. *
  26. */
  27. // use OCP namespace for all classes that are considered public.
  28. // This means that they should be used by apps instead of the internal ownCloud classes
  29. namespace OCP;
  30. /**
  31. * This class provides functions to manage apps in ownCloud
  32. */
  33. class API {
  34. /**
  35. * registers an api call
  36. * @param string $method the http method
  37. * @param string $url the url to match
  38. * @param callable $action the function to run
  39. * @param string $app the id of the app registering the call
  40. * @param int $authLevel the level of authentication required for the call (See OC_API constants)
  41. * @param array $defaults
  42. * @param array $requirements
  43. */
  44. public static function register($method, $url, $action, $app, $authLevel = OC_API::USER_AUTH,
  45. $defaults = array(), $requirements = array()){
  46. \OC_API::register($method, $url, $action, $app, $authLevel, $defaults, $requirements);
  47. }
  48. }