|
| 1 | +<?php |
| 2 | + |
| 3 | +use Symfony\Component\Routing\Exception\MethodNotAllowedException; |
| 4 | +use Symfony\Component\Routing\Exception\ResourceNotFoundException; |
| 5 | +use Symfony\Component\Routing\RequestContext; |
| 6 | + |
| 7 | +/** |
| 8 | + * This class has been auto-generated |
| 9 | + * by the Symfony Routing Component. |
| 10 | + */ |
| 11 | +class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher |
| 12 | +{ |
| 13 | + public function __construct(RequestContext $context) |
| 14 | + { |
| 15 | + $this->context = $context; |
| 16 | + } |
| 17 | + |
| 18 | + public function match($rawPathinfo) |
| 19 | + { |
| 20 | + $allow = array(); |
| 21 | + $pathinfo = rawurldecode($rawPathinfo); |
| 22 | + $trimmedPathinfo = rtrim($pathinfo, '/'); |
| 23 | + $context = $this->context; |
| 24 | + $requestMethod = $canonicalMethod = $context->getMethod(); |
| 25 | + $host = strtolower($context->getHost()); |
| 26 | + |
| 27 | + if ('HEAD' === $requestMethod) { |
| 28 | + $canonicalMethod = 'GET'; |
| 29 | + } |
| 30 | + |
| 31 | + $matchedPathinfo = $host.$pathinfo; |
| 32 | + $regexList = array( |
| 33 | + 0 => '{^(?' |
| 34 | + .'|(?i:([^\\.]++)\\.exampple\\.com)(?' |
| 35 | + .'|/abc([^/]++)(?' |
| 36 | + .'|(*:54)' |
| 37 | + .')' |
| 38 | + .')' |
| 39 | + .')$}sD', |
| 40 | + ); |
| 41 | + |
| 42 | + foreach ($regexList as $offset => $regex) { |
| 43 | + while (preg_match($regex, $matchedPathinfo, $matches)) { |
| 44 | + switch ($m = (int) $matches['MARK']) { |
| 45 | + case 54: |
| 46 | + $matches = array('foo' => $matches[1] ?? null, 'foo' => $matches[2] ?? null); |
| 47 | + |
| 48 | + // r1 |
| 49 | + return $this->mergeDefaults(array_replace($matches, array('_route' => 'r1')), array()); |
| 50 | + |
| 51 | + // r2 |
| 52 | + return $this->mergeDefaults(array_replace($matches, array('_route' => 'r2')), array()); |
| 53 | + |
| 54 | + break; |
| 55 | + } |
| 56 | + |
| 57 | + if (54 === $m) { |
| 58 | + break; |
| 59 | + } |
| 60 | + $regex = substr_replace($regex, 'F', $m - $offset, 1 + strlen($m)); |
| 61 | + $offset += strlen($m); |
| 62 | + } |
| 63 | + } |
| 64 | + |
| 65 | + throw $allow ? new MethodNotAllowedException(array_keys($allow)) : new ResourceNotFoundException(); |
| 66 | + } |
| 67 | +} |
0 commit comments