/PHP/Test/app/cache/dev/appdevUrlMatcher.php

https://bitbucket.org/AdriVanHoudt/school · PHP · 198 lines · 125 code · 40 blank · 33 comment · 41 complexity · 47e7e43dfac123f114a22a6c379ee9ea MD5 · raw file

  1. <?php
  2. use Symfony\Component\Routing\Exception\MethodNotAllowedException;
  3. use Symfony\Component\Routing\Exception\ResourceNotFoundException;
  4. use Symfony\Component\Routing\RequestContext;
  5. /**
  6. * appdevUrlMatcher
  7. *
  8. * This class has been auto-generated
  9. * by the Symfony Routing Component.
  10. */
  11. class appdevUrlMatcher extends Symfony\Bundle\FrameworkBundle\Routing\RedirectableUrlMatcher
  12. {
  13. /**
  14. * Constructor.
  15. */
  16. public function __construct(RequestContext $context)
  17. {
  18. $this->context = $context;
  19. }
  20. public function match($pathinfo)
  21. {
  22. $allow = array();
  23. $pathinfo = rawurldecode($pathinfo);
  24. if (0 === strpos($pathinfo, '/_')) {
  25. // _wdt
  26. if (0 === strpos($pathinfo, '/_wdt') && preg_match('#^/_wdt/(?P<token>[^/]++)$#s', $pathinfo, $matches)) {
  27. return $this->mergeDefaults(array_replace($matches, array('_route' => '_wdt')), array ( '_controller' => 'web_profiler.controller.profiler:toolbarAction',));
  28. }
  29. if (0 === strpos($pathinfo, '/_profiler')) {
  30. // _profiler_home
  31. if (rtrim($pathinfo, '/') === '/_profiler') {
  32. if (substr($pathinfo, -1) !== '/') {
  33. return $this->redirect($pathinfo.'/', '_profiler_home');
  34. }
  35. return array ( '_controller' => 'web_profiler.controller.profiler:homeAction', '_route' => '_profiler_home',);
  36. }
  37. if (0 === strpos($pathinfo, '/_profiler/search')) {
  38. // _profiler_search
  39. if ($pathinfo === '/_profiler/search') {
  40. return array ( '_controller' => 'web_profiler.controller.profiler:searchAction', '_route' => '_profiler_search',);
  41. }
  42. // _profiler_search_bar
  43. if ($pathinfo === '/_profiler/search_bar') {
  44. return array ( '_controller' => 'web_profiler.controller.profiler:searchBarAction', '_route' => '_profiler_search_bar',);
  45. }
  46. }
  47. // _profiler_purge
  48. if ($pathinfo === '/_profiler/purge') {
  49. return array ( '_controller' => 'web_profiler.controller.profiler:purgeAction', '_route' => '_profiler_purge',);
  50. }
  51. if (0 === strpos($pathinfo, '/_profiler/i')) {
  52. // _profiler_info
  53. if (0 === strpos($pathinfo, '/_profiler/info') && preg_match('#^/_profiler/info/(?P<about>[^/]++)$#s', $pathinfo, $matches)) {
  54. return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_info')), array ( '_controller' => 'web_profiler.controller.profiler:infoAction',));
  55. }
  56. // _profiler_import
  57. if ($pathinfo === '/_profiler/import') {
  58. return array ( '_controller' => 'web_profiler.controller.profiler:importAction', '_route' => '_profiler_import',);
  59. }
  60. }
  61. // _profiler_export
  62. if (0 === strpos($pathinfo, '/_profiler/export') && preg_match('#^/_profiler/export/(?P<token>[^/\\.]++)\\.txt$#s', $pathinfo, $matches)) {
  63. return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_export')), array ( '_controller' => 'web_profiler.controller.profiler:exportAction',));
  64. }
  65. // _profiler_phpinfo
  66. if ($pathinfo === '/_profiler/phpinfo') {
  67. return array ( '_controller' => 'web_profiler.controller.profiler:phpinfoAction', '_route' => '_profiler_phpinfo',);
  68. }
  69. // _profiler_search_results
  70. if (preg_match('#^/_profiler/(?P<token>[^/]++)/search/results$#s', $pathinfo, $matches)) {
  71. return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_search_results')), array ( '_controller' => 'web_profiler.controller.profiler:searchResultsAction',));
  72. }
  73. // _profiler
  74. if (preg_match('#^/_profiler/(?P<token>[^/]++)$#s', $pathinfo, $matches)) {
  75. return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler')), array ( '_controller' => 'web_profiler.controller.profiler:panelAction',));
  76. }
  77. // _profiler_router
  78. if (preg_match('#^/_profiler/(?P<token>[^/]++)/router$#s', $pathinfo, $matches)) {
  79. return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_router')), array ( '_controller' => 'web_profiler.controller.router:panelAction',));
  80. }
  81. // _profiler_exception
  82. if (preg_match('#^/_profiler/(?P<token>[^/]++)/exception$#s', $pathinfo, $matches)) {
  83. return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_exception')), array ( '_controller' => 'web_profiler.controller.exception:showAction',));
  84. }
  85. // _profiler_exception_css
  86. if (preg_match('#^/_profiler/(?P<token>[^/]++)/exception\\.css$#s', $pathinfo, $matches)) {
  87. return $this->mergeDefaults(array_replace($matches, array('_route' => '_profiler_exception_css')), array ( '_controller' => 'web_profiler.controller.exception:cssAction',));
  88. }
  89. }
  90. if (0 === strpos($pathinfo, '/_configurator')) {
  91. // _configurator_home
  92. if (rtrim($pathinfo, '/') === '/_configurator') {
  93. if (substr($pathinfo, -1) !== '/') {
  94. return $this->redirect($pathinfo.'/', '_configurator_home');
  95. }
  96. return array ( '_controller' => 'Sensio\\Bundle\\DistributionBundle\\Controller\\ConfiguratorController::checkAction', '_route' => '_configurator_home',);
  97. }
  98. // _configurator_step
  99. if (0 === strpos($pathinfo, '/_configurator/step') && preg_match('#^/_configurator/step/(?P<index>[^/]++)$#s', $pathinfo, $matches)) {
  100. return $this->mergeDefaults(array_replace($matches, array('_route' => '_configurator_step')), array ( '_controller' => 'Sensio\\Bundle\\DistributionBundle\\Controller\\ConfiguratorController::stepAction',));
  101. }
  102. // _configurator_final
  103. if ($pathinfo === '/_configurator/final') {
  104. return array ( '_controller' => 'Sensio\\Bundle\\DistributionBundle\\Controller\\ConfiguratorController::finalAction', '_route' => '_configurator_final',);
  105. }
  106. }
  107. }
  108. if (0 === strpos($pathinfo, '/article')) {
  109. // article
  110. if (rtrim($pathinfo, '/') === '/article') {
  111. if (substr($pathinfo, -1) !== '/') {
  112. return $this->redirect($pathinfo.'/', 'article');
  113. }
  114. return array ( '_controller' => 'Adri\\NewsBundle\\Controller\\ArticleController::indexAction', '_route' => 'article',);
  115. }
  116. // article_show
  117. if (preg_match('#^/article/(?P<id>[^/]++)/show$#s', $pathinfo, $matches)) {
  118. return $this->mergeDefaults(array_replace($matches, array('_route' => 'article_show')), array ( '_controller' => 'Adri\\NewsBundle\\Controller\\ArticleController::showAction',));
  119. }
  120. // article_new
  121. if ($pathinfo === '/article/new') {
  122. return array ( '_controller' => 'Adri\\NewsBundle\\Controller\\ArticleController::newAction', '_route' => 'article_new',);
  123. }
  124. // article_create
  125. if ($pathinfo === '/article/create') {
  126. if ($this->context->getMethod() != 'POST') {
  127. $allow[] = 'POST';
  128. goto not_article_create;
  129. }
  130. return array ( '_controller' => 'Adri\\NewsBundle\\Controller\\ArticleController::createAction', '_route' => 'article_create',);
  131. }
  132. not_article_create:
  133. // article_edit
  134. if (preg_match('#^/article/(?P<id>[^/]++)/edit$#s', $pathinfo, $matches)) {
  135. return $this->mergeDefaults(array_replace($matches, array('_route' => 'article_edit')), array ( '_controller' => 'Adri\\NewsBundle\\Controller\\ArticleController::editAction',));
  136. }
  137. // article_update
  138. if (preg_match('#^/article/(?P<id>[^/]++)/update$#s', $pathinfo, $matches)) {
  139. if (!in_array($this->context->getMethod(), array('POST', 'PUT'))) {
  140. $allow = array_merge($allow, array('POST', 'PUT'));
  141. goto not_article_update;
  142. }
  143. return $this->mergeDefaults(array_replace($matches, array('_route' => 'article_update')), array ( '_controller' => 'Adri\\NewsBundle\\Controller\\ArticleController::updateAction',));
  144. }
  145. not_article_update:
  146. // article_delete
  147. if (preg_match('#^/article/(?P<id>[^/]++)/delete$#s', $pathinfo, $matches)) {
  148. if (!in_array($this->context->getMethod(), array('POST', 'DELETE'))) {
  149. $allow = array_merge($allow, array('POST', 'DELETE'));
  150. goto not_article_delete;
  151. }
  152. return $this->mergeDefaults(array_replace($matches, array('_route' => 'article_delete')), array ( '_controller' => 'Adri\\NewsBundle\\Controller\\ArticleController::deleteAction',));
  153. }
  154. not_article_delete:
  155. }
  156. throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();
  157. }
  158. }