3 use Symfony\Component\Routing\Exception\MethodNotAllowedException;
4 use Symfony\Component\Routing\Exception\ResourceNotFoundException;
5 use Symfony\Component\Routing\RequestContext;
10 * This class has been auto-generated
11 * by the Symfony Routing Component.
13 class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher
18 public function __construct(RequestContext $context)
20 $this->context = $context;
23 public function match($pathinfo)
26 $pathinfo = rawurldecode($pathinfo);
27 $context = $this->context;
28 $request = $this->request;
31 if (0 === strpos($pathinfo, '/foo') && preg_match('#^/foo/(?P<bar>baz|symfony)$#s', $pathinfo, $matches)) {
32 return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo')), array ( 'def' => 'test',));
35 if (0 === strpos($pathinfo, '/bar')) {
37 if (preg_match('#^/bar/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) {
38 if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
39 $allow = array_merge($allow, array('GET', 'HEAD'));
43 return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar')), array ());
48 if (0 === strpos($pathinfo, '/barhead') && preg_match('#^/barhead/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) {
49 if (!in_array($this->context->getMethod(), array('GET', 'HEAD'))) {
50 $allow = array_merge($allow, array('GET', 'HEAD'));
54 return $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array ());
60 if (0 === strpos($pathinfo, '/test')) {
61 if (0 === strpos($pathinfo, '/test/baz')) {
63 if ($pathinfo === '/test/baz') {
64 return array('_route' => 'baz');
68 if ($pathinfo === '/test/baz.html') {
69 return array('_route' => 'baz2');
73 if ($pathinfo === '/test/baz3/') {
74 return array('_route' => 'baz3');
80 if (preg_match('#^/test/(?P<foo>[^/]++)/$#s', $pathinfo, $matches)) {
81 return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz4')), array ());
85 if (preg_match('#^/test/(?P<foo>[^/]++)/$#s', $pathinfo, $matches)) {
86 if ($this->context->getMethod() != 'POST') {
91 return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz5')), array ());
96 if (preg_match('#^/test/(?P<foo>[^/]++)/$#s', $pathinfo, $matches)) {
97 if ($this->context->getMethod() != 'PUT') {
102 return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array ());
109 if ($pathinfo === '/foofoo') {
110 return array ( 'def' => 'test', '_route' => 'foofoo',);
114 if (preg_match('#^/(?P<quoter>[\']+)$#s', $pathinfo, $matches)) {
115 return $this->mergeDefaults(array_replace($matches, array('_route' => 'quoter')), array ());
119 if ($pathinfo === '/spa ce') {
120 return array('_route' => 'space');
123 if (0 === strpos($pathinfo, '/a')) {
124 if (0 === strpos($pathinfo, '/a/b\'b')) {
126 if (preg_match('#^/a/b\'b/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) {
127 return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo1')), array ());
131 if (preg_match('#^/a/b\'b/(?P<bar>[^/]++)$#s', $pathinfo, $matches)) {
132 return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar1')), array ());
138 if (preg_match('#^/a/(?P<var>.*)$#s', $pathinfo, $matches)) {
139 return $this->mergeDefaults(array_replace($matches, array('_route' => 'overridden')), array ());
142 if (0 === strpos($pathinfo, '/a/b\'b')) {
144 if (preg_match('#^/a/b\'b/(?P<foo1>[^/]++)$#s', $pathinfo, $matches)) {
145 return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo2')), array ());
149 if (preg_match('#^/a/b\'b/(?P<bar1>[^/]++)$#s', $pathinfo, $matches)) {
150 return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar2')), array ());
157 if (0 === strpos($pathinfo, '/multi')) {
159 if (0 === strpos($pathinfo, '/multi/hello') && preg_match('#^/multi/hello(?:/(?P<who>[^/]++))?$#s', $pathinfo, $matches)) {
160 return $this->mergeDefaults(array_replace($matches, array('_route' => 'helloWorld')), array ( 'who' => 'World!',));
164 if ($pathinfo === '/multi/new') {
165 return array('_route' => 'overridden2');
169 if ($pathinfo === '/multi/hey/') {
170 return array('_route' => 'hey');
176 if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) {
177 return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo3')), array ());
181 if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<bar>[^/]++)$#s', $pathinfo, $matches)) {
182 return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar3')), array ());
185 if (0 === strpos($pathinfo, '/aba')) {
187 if ($pathinfo === '/ababa') {
188 return array('_route' => 'ababa');
192 if (preg_match('#^/aba/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) {
193 return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo4')), array ());
198 $host = $this->context->getHost();
200 if (preg_match('#^a\\.example\\.com$#si', $host, $hostMatches)) {
202 if ($pathinfo === '/route1') {
203 return array('_route' => 'route1');
207 if ($pathinfo === '/c2/route2') {
208 return array('_route' => 'route2');
213 if (preg_match('#^b\\.example\\.com$#si', $host, $hostMatches)) {
215 if ($pathinfo === '/c2/route3') {
216 return array('_route' => 'route3');
221 if (preg_match('#^a\\.example\\.com$#si', $host, $hostMatches)) {
223 if ($pathinfo === '/route4') {
224 return array('_route' => 'route4');
229 if (preg_match('#^c\\.example\\.com$#si', $host, $hostMatches)) {
231 if ($pathinfo === '/route5') {
232 return array('_route' => 'route5');
238 if ($pathinfo === '/route6') {
239 return array('_route' => 'route6');
242 if (preg_match('#^(?P<var1>[^\\.]++)\\.example\\.com$#si', $host, $hostMatches)) {
243 if (0 === strpos($pathinfo, '/route1')) {
245 if ($pathinfo === '/route11') {
246 return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route11')), array ());
250 if ($pathinfo === '/route12') {
251 return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route12')), array ( 'var1' => 'val',));
255 if (0 === strpos($pathinfo, '/route13') && preg_match('#^/route13/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
256 return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route13')), array ());
260 if (0 === strpos($pathinfo, '/route14') && preg_match('#^/route14/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
261 return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route14')), array ( 'var1' => 'val',));
268 if (preg_match('#^c\\.example\\.com$#si', $host, $hostMatches)) {
270 if (0 === strpos($pathinfo, '/route15') && preg_match('#^/route15/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
271 return $this->mergeDefaults(array_replace($matches, array('_route' => 'route15')), array ());
276 if (0 === strpos($pathinfo, '/route1')) {
278 if (0 === strpos($pathinfo, '/route16') && preg_match('#^/route16/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
279 return $this->mergeDefaults(array_replace($matches, array('_route' => 'route16')), array ( 'var1' => 'val',));
283 if ($pathinfo === '/route17') {
284 return array('_route' => 'route17');
289 if (0 === strpos($pathinfo, '/a')) {
291 if ($pathinfo === '/a/a...') {
292 return array('_route' => 'a');
295 if (0 === strpos($pathinfo, '/a/b')) {
297 if (preg_match('#^/a/b/(?P<var>[^/]++)$#s', $pathinfo, $matches)) {
298 return $this->mergeDefaults(array_replace($matches, array('_route' => 'b')), array ());
302 if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?P<var>[^/]++)$#s', $pathinfo, $matches)) {
303 return $this->mergeDefaults(array_replace($matches, array('_route' => 'c')), array ());
310 throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();