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);
29 if (0 === strpos($pathinfo, '/foo') && preg_match('#^/foo/(?P<bar>baz|symfony)$#s', $pathinfo, $matches)) {
30 return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo')), array ( 'def' => 'test',));
33 if (0 === strpos($pathinfo, '/bar')) {
35 if (preg_match('#^/bar/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) {
36 if (!in_array($this->context
->getMethod(), array('GET', 'HEAD'))) {
37 $allow = array_merge($allow, array('GET', 'HEAD'));
41 return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar')), array ());
46 if (0 === strpos($pathinfo, '/barhead') && preg_match('#^/barhead/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) {
47 if (!in_array($this->context
->getMethod(), array('GET', 'HEAD'))) {
48 $allow = array_merge($allow, array('GET', 'HEAD'));
52 return $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array ());
58 if (0 === strpos($pathinfo, '/test')) {
59 if (0 === strpos($pathinfo, '/test/baz')) {
61 if ($pathinfo === '/test/baz') {
62 return array('_route' => 'baz');
66 if ($pathinfo === '/test/baz.html') {
67 return array('_route' => 'baz2');
71 if ($pathinfo === '/test/baz3/') {
72 return array('_route' => 'baz3');
78 if (preg_match('#^/test/(?P<foo>[^/]++)/$#s', $pathinfo, $matches)) {
79 return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz4')), array ());
83 if (preg_match('#^/test/(?P<foo>[^/]++)/$#s', $pathinfo, $matches)) {
84 if ($this->context
->getMethod() != 'POST') {
89 return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz5')), array ());
94 if (preg_match('#^/test/(?P<foo>[^/]++)/$#s', $pathinfo, $matches)) {
95 if ($this->context
->getMethod() != 'PUT') {
100 return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array ());
107 if ($pathinfo === '/foofoo') {
108 return array ( 'def' => 'test', '_route' => 'foofoo',);
112 if (preg_match('#^/(?P<quoter>[\']+)$#s', $pathinfo, $matches)) {
113 return $this->mergeDefaults(array_replace($matches, array('_route' => 'quoter')), array ());
117 if ($pathinfo === '/spa ce') {
118 return array('_route' => 'space');
121 if (0 === strpos($pathinfo, '/a')) {
122 if (0 === strpos($pathinfo, '/a/b\'b')) {
124 if (preg_match('#^/a/b\'b/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) {
125 return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo1')), array ());
129 if (preg_match('#^/a/b\'b/(?P<bar>[^/]++)$#s', $pathinfo, $matches)) {
130 return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar1')), array ());
136 if (preg_match('#^/a/(?P<var>.*)$#s', $pathinfo, $matches)) {
137 return $this->mergeDefaults(array_replace($matches, array('_route' => 'overridden')), array ());
140 if (0 === strpos($pathinfo, '/a/b\'b')) {
142 if (preg_match('#^/a/b\'b/(?P<foo1>[^/]++)$#s', $pathinfo, $matches)) {
143 return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo2')), array ());
147 if (preg_match('#^/a/b\'b/(?P<bar1>[^/]++)$#s', $pathinfo, $matches)) {
148 return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar2')), array ());
155 if (0 === strpos($pathinfo, '/multi')) {
157 if (0 === strpos($pathinfo, '/multi/hello') && preg_match('#^/multi/hello(?:/(?P<who>[^/]++))?$#s', $pathinfo, $matches)) {
158 return $this->mergeDefaults(array_replace($matches, array('_route' => 'helloWorld')), array ( 'who' => 'World!',));
162 if ($pathinfo === '/multi/new') {
163 return array('_route' => 'overridden2');
167 if ($pathinfo === '/multi/hey/') {
168 return array('_route' => 'hey');
174 if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) {
175 return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo3')), array ());
179 if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<bar>[^/]++)$#s', $pathinfo, $matches)) {
180 return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar3')), array ());
183 if (0 === strpos($pathinfo, '/aba')) {
185 if ($pathinfo === '/ababa') {
186 return array('_route' => 'ababa');
190 if (preg_match('#^/aba/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) {
191 return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo4')), array ());
196 $host = $this->context
->getHost();
198 if (preg_match('#^a\\.example\\.com$#s', $host, $hostMatches)) {
200 if ($pathinfo === '/route1') {
201 return array('_route' => 'route1');
205 if ($pathinfo === '/c2/route2') {
206 return array('_route' => 'route2');
211 if (preg_match('#^b\\.example\\.com$#s', $host, $hostMatches)) {
213 if ($pathinfo === '/c2/route3') {
214 return array('_route' => 'route3');
219 if (preg_match('#^a\\.example\\.com$#s', $host, $hostMatches)) {
221 if ($pathinfo === '/route4') {
222 return array('_route' => 'route4');
227 if (preg_match('#^c\\.example\\.com$#s', $host, $hostMatches)) {
229 if ($pathinfo === '/route5') {
230 return array('_route' => 'route5');
236 if ($pathinfo === '/route6') {
237 return array('_route' => 'route6');
240 if (preg_match('#^(?P<var1>[^\\.]++)\\.example\\.com$#s', $host, $hostMatches)) {
241 if (0 === strpos($pathinfo, '/route1')) {
243 if ($pathinfo === '/route11') {
244 return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route11')), array ());
248 if ($pathinfo === '/route12') {
249 return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route12')), array ( 'var1' => 'val',));
253 if (0 === strpos($pathinfo, '/route13') && preg_match('#^/route13/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
254 return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route13')), array ());
258 if (0 === strpos($pathinfo, '/route14') && preg_match('#^/route14/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
259 return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route14')), array ( 'var1' => 'val',));
266 if (preg_match('#^c\\.example\\.com$#s', $host, $hostMatches)) {
268 if (0 === strpos($pathinfo, '/route15') && preg_match('#^/route15/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
269 return $this->mergeDefaults(array_replace($matches, array('_route' => 'route15')), array ());
274 if (0 === strpos($pathinfo, '/route1')) {
276 if (0 === strpos($pathinfo, '/route16') && preg_match('#^/route16/(?P<name>[^/]++)$#s', $pathinfo, $matches)) {
277 return $this->mergeDefaults(array_replace($matches, array('_route' => 'route16')), array ( 'var1' => 'val',));
281 if ($pathinfo === '/route17') {
282 return array('_route' => 'route17');
287 if (0 === strpos($pathinfo, '/a')) {
289 if ($pathinfo === '/a/a...') {
290 return array('_route' => 'a');
293 if (0 === strpos($pathinfo, '/a/b')) {
295 if (preg_match('#^/a/b/(?P<var>[^/]++)$#s', $pathinfo, $matches)) {
296 return $this->mergeDefaults(array_replace($matches, array('_route' => 'b')), array ());
300 if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?P<var>[^/]++)$#s', $pathinfo, $matches)) {
301 return $this->mergeDefaults(array_replace($matches, array('_route' => 'c')), array ());
308 throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException();