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.

126 lines
3.0 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 Jörn Friedrich Dreyer <jfd@butonic.de>
  8. * @author Lukas Reschke <lukas@statuscode.ch>
  9. * @author Morris Jobke <hey@morrisjobke.de>
  10. * @author Robin Appelman <robin@icewind.nl>
  11. * @author Roeland Jago Douma <roeland@famdouma.nl>
  12. *
  13. * @license AGPL-3.0
  14. *
  15. * This code is free software: you can redistribute it and/or modify
  16. * it under the terms of the GNU Affero General Public License, version 3,
  17. * as published by the Free Software Foundation.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU Affero General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU Affero General Public License, version 3,
  25. * along with this program. If not, see <http://www.gnu.org/licenses/>
  26. *
  27. */
  28. namespace OCP\Route;
  29. /**
  30. * Interface IRouter
  31. *
  32. * @since 7.0.0
  33. * @deprecated 9.0.0
  34. */
  35. interface IRouter {
  36. /**
  37. * Get the files to load the routes from
  38. *
  39. * @return string[]
  40. * @since 7.0.0
  41. * @deprecated 9.0.0
  42. */
  43. public function getRoutingFiles();
  44. /**
  45. * @return string
  46. * @since 7.0.0
  47. * @deprecated 9.0.0
  48. */
  49. public function getCacheKey();
  50. /**
  51. * Loads the routes
  52. *
  53. * @param null|string $app
  54. * @since 7.0.0
  55. * @deprecated 9.0.0
  56. */
  57. public function loadRoutes($app = null);
  58. /**
  59. * Sets the collection to use for adding routes
  60. *
  61. * @param string $name Name of the collection to use.
  62. * @return void
  63. * @since 7.0.0
  64. * @deprecated 9.0.0
  65. */
  66. public function useCollection($name);
  67. /**
  68. * returns the current collection name in use for adding routes
  69. *
  70. * @return string the collection name
  71. * @since 8.0.0
  72. * @deprecated 9.0.0
  73. */
  74. public function getCurrentCollection();
  75. /**
  76. * Create a \OCP\Route\IRoute.
  77. *
  78. * @param string $name Name of the route to create.
  79. * @param string $pattern The pattern to match
  80. * @param array $defaults An array of default parameter values
  81. * @param array $requirements An array of requirements for parameters (regexes)
  82. * @return \OCP\Route\IRoute
  83. * @since 7.0.0
  84. * @deprecated 9.0.0
  85. */
  86. public function create($name, $pattern, array $defaults = [], array $requirements = []);
  87. /**
  88. * Find the route matching $url.
  89. *
  90. * @param string $url The url to find
  91. * @throws \Exception
  92. * @return void
  93. * @since 7.0.0
  94. * @deprecated 9.0.0
  95. */
  96. public function match($url);
  97. /**
  98. * Get the url generator
  99. *
  100. * @since 7.0.0
  101. * @deprecated 9.0.0
  102. */
  103. public function getGenerator();
  104. /**
  105. * Generate url based on $name and $parameters
  106. *
  107. * @param string $name Name of the route to use.
  108. * @param array $parameters Parameters for the route
  109. * @param bool $absolute
  110. * @return string
  111. * @since 7.0.0
  112. * @deprecated 9.0.0
  113. */
  114. public function generate($name, $parameters = [], $absolute = false);
  115. }