3 use Symfony\Component\Routing\Exception\MethodNotAllowedException;
4 use Symfony\Component\Routing\Exception\ResourceNotFoundException;
5 use Symfony\Component\Routing\RequestContext;
8 * This class has been auto-generated
9 * by the Symfony Routing Component.
11 class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
13 public function __construct(RequestContext $context)
15 $this->context = $context;
18 public function match($rawPathinfo)
21 $pathinfo = rawurldecode($rawPathinfo);
22 $trimmedPathinfo = rtrim($pathinfo, '/');
23 $context = $this->context;
24 $request = $this->request ?: $this->createRequest($pathinfo);
25 $requestMethod = $canonicalMethod = $context->getMethod();
27 if ('HEAD' === $requestMethod) {
28 $canonicalMethod = 'GET';
31 if (0 === strpos($pathinfo, '/foo')) {
33 if (preg_match('#^/foo/(?P<bar>baz|symfony)$#sD', $pathinfo, $matches)) {
34 return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo')), array ( 'def' => 'test',));
38 if ('/foofoo' === $pathinfo) {
39 return array ( 'def' => 'test', '_route' => 'foofoo',);
44 elseif (0 === strpos($pathinfo, '/bar')) {
46 if (preg_match('#^/bar/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) {
47 $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'bar')), array ());
48 if (!in_array($canonicalMethod, array('GET', 'HEAD'))) {
49 $allow = array_merge($allow, array('GET', 'HEAD'));
58 if (0 === strpos($pathinfo, '/barhead') && preg_match('#^/barhead/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) {
59 $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array ());
60 if (!in_array($canonicalMethod, array('GET'))) {
61 $allow = array_merge($allow, array('GET'));
71 elseif (0 === strpos($pathinfo, '/test')) {
72 if (0 === strpos($pathinfo, '/test/baz')) {
74 if ('/test/baz' === $pathinfo) {
75 return array('_route' => 'baz');
79 if ('/test/baz.html' === $pathinfo) {
80 return array('_route' => 'baz2');
84 if ('/test/baz3/' === $pathinfo) {
85 return array('_route' => 'baz3');
91 if (preg_match('#^/test/(?P<foo>[^/]++)/$#sD', $pathinfo, $matches)) {
92 return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz4')), array ());
96 if (preg_match('#^/test/(?P<foo>[^/]++)/$#sD', $pathinfo, $matches)) {
97 $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz5')), array ());
98 if (!in_array($requestMethod, array('POST'))) {
99 $allow = array_merge($allow, array('POST'));
108 if (preg_match('#^/test/(?P<foo>[^/]++)/$#sD', $pathinfo, $matches)) {
109 $ret = $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array ());
110 if (!in_array($requestMethod, array('PUT'))) {
111 $allow = array_merge($allow, array('PUT'));
122 if (preg_match('#^/(?P<quoter>[\']+)$#sD', $pathinfo, $matches)) {
123 return $this->mergeDefaults(array_replace($matches, array('_route' => 'quoter')), array ());
127 if ('/spa ce' === $pathinfo) {
128 return array('_route' => 'space');
131 if (0 === strpos($pathinfo, '/a')) {
132 if (0 === strpos($pathinfo, '/a/b\'b')) {
134 if (preg_match('#^/a/b\'b/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) {
135 return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo1')), array ());
139 if (preg_match('#^/a/b\'b/(?P<bar>[^/]++)$#sD', $pathinfo, $matches)) {
140 return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar1')), array ());
146 if (preg_match('#^/a/(?P<var>.*)$#sD', $pathinfo, $matches)) {
147 return $this->mergeDefaults(array_replace($matches, array('_route' => 'overridden')), array ());
150 if (0 === strpos($pathinfo, '/a/b\'b')) {
152 if (preg_match('#^/a/b\'b/(?P<foo1>[^/]++)$#sD', $pathinfo, $matches)) {
153 return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo2')), array ());
157 if (preg_match('#^/a/b\'b/(?P<bar1>[^/]++)$#sD', $pathinfo, $matches)) {
158 return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar2')), array ());
165 elseif (0 === strpos($pathinfo, '/multi')) {
167 if (0 === strpos($pathinfo, '/multi/hello') && preg_match('#^/multi/hello(?:/(?P<who>[^/]++))?$#sD', $pathinfo, $matches)) {
168 return $this->mergeDefaults(array_replace($matches, array('_route' => 'helloWorld')), array ( 'who' => 'World!',));
172 if ('/multi/hey/' === $pathinfo) {
173 return array('_route' => 'hey');
177 if ('/multi/new' === $pathinfo) {
178 return array('_route' => 'overridden2');
184 if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) {
185 return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo3')), array ());
189 if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<bar>[^/]++)$#sD', $pathinfo, $matches)) {
190 return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar3')), array ());
193 if (0 === strpos($pathinfo, '/aba')) {
195 if ('/ababa' === $pathinfo) {
196 return array('_route' => 'ababa');
200 if (preg_match('#^/aba/(?P<foo>[^/]++)$#sD', $pathinfo, $matches)) {
201 return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo4')), array ());
206 $host = $context->getHost();
208 if (preg_match('#^a\\.example\\.com$#sDi', $host, $hostMatches)) {
210 if ('/route1' === $pathinfo) {
211 return array('_route' => 'route1');
215 if ('/c2/route2' === $pathinfo) {
216 return array('_route' => 'route2');
221 if (preg_match('#^b\\.example\\.com$#sDi', $host, $hostMatches)) {
223 if ('/c2/route3' === $pathinfo) {
224 return array('_route' => 'route3');
229 if (preg_match('#^a\\.example\\.com$#sDi', $host, $hostMatches)) {
231 if ('/route4' === $pathinfo) {
232 return array('_route' => 'route4');
237 if (preg_match('#^c\\.example\\.com$#sDi', $host, $hostMatches)) {
239 if ('/route5' === $pathinfo) {
240 return array('_route' => 'route5');
246 if ('/route6' === $pathinfo) {
247 return array('_route' => 'route6');
250 if (preg_match('#^(?P<var1>[^\\.]++)\\.example\\.com$#sDi', $host, $hostMatches)) {
251 if (0 === strpos($pathinfo, '/route1')) {
253 if ('/route11' === $pathinfo) {
254 return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route11')), array ());
258 if ('/route12' === $pathinfo) {
259 return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route12')), array ( 'var1' => 'val',));
263 if (0 === strpos($pathinfo, '/route13') && preg_match('#^/route13/(?P<name>[^/]++)$#sD', $pathinfo, $matches)) {
264 return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route13')), array ());
268 if (0 === strpos($pathinfo, '/route14') && preg_match('#^/route14/(?P<name>[^/]++)$#sD', $pathinfo, $matches)) {
269 return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route14')), array ( 'var1' => 'val',));
276 if (preg_match('#^c\\.example\\.com$#sDi', $host, $hostMatches)) {
278 if (0 === strpos($pathinfo, '/route15') && preg_match('#^/route15/(?P<name>[^/]++)$#sD', $pathinfo, $matches)) {
279 return $this->mergeDefaults(array_replace($matches, array('_route' => 'route15')), array ());
285 if (0 === strpos($pathinfo, '/route16') && preg_match('#^/route16/(?P<name>[^/]++)$#sD', $pathinfo, $matches)) {
286 return $this->mergeDefaults(array_replace($matches, array('_route' => 'route16')), array ( 'var1' => 'val',));
290 if ('/route17' === $pathinfo) {
291 return array('_route' => 'route17');
295 if ('/a/a...' === $pathinfo) {
296 return array('_route' => 'a');
299 if (0 === strpos($pathinfo, '/a/b')) {
301 if (preg_match('#^/a/b/(?P<var>[^/]++)$#sD', $pathinfo, $matches)) {
302 return $this->mergeDefaults(array_replace($matches, array('_route' => 'b')), array ());
306 if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?P<var>[^/]++)$#sD', $pathinfo, $matches)) {
307 return $this->mergeDefaults(array_replace($matches, array('_route' => 'c')), array ());
312 if ('/' === $pathinfo && !$allow) {
313 throw new Symfony\Component\Routing\Exception\NoConfigurationException();
316 throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();