1
0

IRouter.php 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <?php
  2. /**
  3. * @copyright Copyright (c) 2016, ownCloud, Inc.
  4. *
  5. * @author Bart Visscher <bartv@thisnet.nl>
  6. * @author Jörn Friedrich Dreyer <jfd@butonic.de>
  7. * @author Lukas Reschke <lukas@statuscode.ch>
  8. * @author Morris Jobke <hey@morrisjobke.de>
  9. * @author Robin Appelman <robin@icewind.nl>
  10. * @author Roeland Jago Douma <roeland@famdouma.nl>
  11. *
  12. * @license AGPL-3.0
  13. *
  14. * This code is free software: you can redistribute it and/or modify
  15. * it under the terms of the GNU Affero General Public License, version 3,
  16. * as published by the Free Software Foundation.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU Affero General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU Affero General Public License, version 3,
  24. * along with this program. If not, see <http://www.gnu.org/licenses/>
  25. *
  26. */
  27. namespace OCP\Route;
  28. /**
  29. * Interface IRouter
  30. *
  31. * @package OCP\Route
  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(), array $requirements = array());
  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 = array(), $absolute = false);
  115. }