url_matcher1.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * ProjectUrlMatcher
  4. *
  5. * This class has been auto-generated
  6. * by the Symfony Routing Component.
  7. */
  8. class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
  9. {
  10. /**
  11. * Constructor.
  12. */
  13. public function __construct(array $context = array(), array $defaults = array())
  14. {
  15. $this->context = $context;
  16. $this->defaults = $defaults;
  17. }
  18. public function match($pathinfo)
  19. {
  20. if (0 === strpos($pathinfo, '/foo') && preg_match('#^/foo/(?P<bar>baz|symfony)$#x', $pathinfo, $matches)) {
  21. return array_merge($this->mergeDefaults($matches, array ( 'def' => 'test',)), array('_route' => 'foo'));
  22. }
  23. if (isset($this->context['method']) && preg_match('#^(GET|head)$#xi', $this->context['method']) && 0 === strpos($pathinfo, '/bar') && preg_match('#^/bar/(?P<foo>[^/\.]+?)$#x', $pathinfo, $matches)) {
  24. return array_merge($this->mergeDefaults($matches, array ()), array('_route' => 'bar'));
  25. }
  26. if ($pathinfo === '/test/baz') {
  27. return array_merge($this->mergeDefaults(array(), array ()), array('_route' => 'baz'));
  28. }
  29. if ($pathinfo === '/test/baz.html') {
  30. return array_merge($this->mergeDefaults(array(), array ()), array('_route' => 'baz2'));
  31. }
  32. if (rtrim($pathinfo, '/') === '/test/baz3') {
  33. if (substr($pathinfo, -1) !== '/') {
  34. return array('_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction', 'url' => $this->context['base_url'].$pathinfo.'/', 'permanent' => true, '_route' => 'baz3');
  35. }
  36. return array_merge($this->mergeDefaults(array(), array ()), array('_route' => 'baz3'));
  37. }
  38. if (0 === strpos($pathinfo, '/test') && preg_match('#^/test/(?P<foo>[^/\.]+?)/?$#x', $pathinfo, $matches)) {
  39. if (substr($pathinfo, -1) !== '/') {
  40. return array('_controller' => 'Symfony\Bundle\FrameworkBundle\Controller\RedirectController::urlRedirectAction', 'url' => $this->context['base_url'].$pathinfo.'/', 'permanent' => true, '_route' => 'baz4');
  41. }
  42. return array_merge($this->mergeDefaults($matches, array ()), array('_route' => 'baz4'));
  43. }
  44. return false;
  45. }
  46. }