diff options
Diffstat (limited to 'vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper')
5 files changed, 863 insertions, 0 deletions
diff --git a/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.apache b/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.apache new file mode 100644 index 00000000..26a561cc --- /dev/null +++ b/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.apache | |||
@@ -0,0 +1,163 @@ | |||
1 | # skip "real" requests | ||
2 | RewriteCond %{REQUEST_FILENAME} -f | ||
3 | RewriteRule .* - [QSA,L] | ||
4 | |||
5 | # foo | ||
6 | RewriteCond %{REQUEST_URI} ^/foo/(baz|symfony)$ | ||
7 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:foo,E=_ROUTING_param_bar:%1,E=_ROUTING_default_def:test] | ||
8 | |||
9 | # foobar | ||
10 | RewriteCond %{REQUEST_URI} ^/foo(?:/([^/]++))?$ | ||
11 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:foobar,E=_ROUTING_param_bar:%1,E=_ROUTING_default_bar:toto] | ||
12 | |||
13 | # bar | ||
14 | RewriteCond %{REQUEST_URI} ^/bar/([^/]++)$ | ||
15 | RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [NC] | ||
16 | RewriteRule .* - [S=1,E=_ROUTING_allow_GET:1,E=_ROUTING_allow_HEAD:1] | ||
17 | RewriteCond %{REQUEST_URI} ^/bar/([^/]++)$ | ||
18 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:bar,E=_ROUTING_param_foo:%1] | ||
19 | |||
20 | # baragain | ||
21 | RewriteCond %{REQUEST_URI} ^/baragain/([^/]++)$ | ||
22 | RewriteCond %{REQUEST_METHOD} !^(GET|POST|HEAD)$ [NC] | ||
23 | RewriteRule .* - [S=1,E=_ROUTING_allow_GET:1,E=_ROUTING_allow_POST:1,E=_ROUTING_allow_HEAD:1] | ||
24 | RewriteCond %{REQUEST_URI} ^/baragain/([^/]++)$ | ||
25 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:baragain,E=_ROUTING_param_foo:%1] | ||
26 | |||
27 | # baz | ||
28 | RewriteCond %{REQUEST_URI} ^/test/baz$ | ||
29 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:baz] | ||
30 | |||
31 | # baz2 | ||
32 | RewriteCond %{REQUEST_URI} ^/test/baz\.html$ | ||
33 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:baz2] | ||
34 | |||
35 | # baz3 | ||
36 | RewriteCond %{REQUEST_URI} ^/test/baz3$ | ||
37 | RewriteRule .* $0/ [QSA,L,R=301] | ||
38 | RewriteCond %{REQUEST_URI} ^/test/baz3/$ | ||
39 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:baz3] | ||
40 | |||
41 | # baz4 | ||
42 | RewriteCond %{REQUEST_URI} ^/test/([^/]++)$ | ||
43 | RewriteRule .* $0/ [QSA,L,R=301] | ||
44 | RewriteCond %{REQUEST_URI} ^/test/([^/]++)/$ | ||
45 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:baz4,E=_ROUTING_param_foo:%1] | ||
46 | |||
47 | # baz5 | ||
48 | RewriteCond %{REQUEST_URI} ^/test/([^/]++)/$ | ||
49 | RewriteCond %{REQUEST_METHOD} !^(GET|HEAD)$ [NC] | ||
50 | RewriteRule .* - [S=2,E=_ROUTING_allow_GET:1,E=_ROUTING_allow_HEAD:1] | ||
51 | RewriteCond %{REQUEST_URI} ^/test/([^/]++)$ | ||
52 | RewriteRule .* $0/ [QSA,L,R=301] | ||
53 | RewriteCond %{REQUEST_URI} ^/test/([^/]++)/$ | ||
54 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:baz5,E=_ROUTING_param_foo:%1] | ||
55 | |||
56 | # baz5unsafe | ||
57 | RewriteCond %{REQUEST_URI} ^/testunsafe/([^/]++)/$ | ||
58 | RewriteCond %{REQUEST_METHOD} !^(POST)$ [NC] | ||
59 | RewriteRule .* - [S=1,E=_ROUTING_allow_POST:1] | ||
60 | RewriteCond %{REQUEST_URI} ^/testunsafe/([^/]++)/$ | ||
61 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:baz5unsafe,E=_ROUTING_param_foo:%1] | ||
62 | |||
63 | # baz6 | ||
64 | RewriteCond %{REQUEST_URI} ^/test/baz$ | ||
65 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:baz6,E=_ROUTING_default_foo:bar\ baz] | ||
66 | |||
67 | # baz7 | ||
68 | RewriteCond %{REQUEST_URI} ^/te\ st/baz$ | ||
69 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:baz7] | ||
70 | |||
71 | # baz8 | ||
72 | RewriteCond %{REQUEST_URI} ^/te\\\ st/baz$ | ||
73 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:baz8] | ||
74 | |||
75 | # baz9 | ||
76 | RewriteCond %{REQUEST_URI} ^/test/(te\\\ st)$ | ||
77 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:baz9,E=_ROUTING_param_baz:%1] | ||
78 | |||
79 | RewriteCond %{HTTP:Host} ^a\.example\.com$ | ||
80 | RewriteRule .? - [E=__ROUTING_host_1:1] | ||
81 | |||
82 | # route1 | ||
83 | RewriteCond %{ENV:__ROUTING_host_1} =1 | ||
84 | RewriteCond %{REQUEST_URI} ^/route1$ | ||
85 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:route1] | ||
86 | |||
87 | # route2 | ||
88 | RewriteCond %{ENV:__ROUTING_host_1} =1 | ||
89 | RewriteCond %{REQUEST_URI} ^/c2/route2$ | ||
90 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:route2] | ||
91 | |||
92 | RewriteCond %{HTTP:Host} ^b\.example\.com$ | ||
93 | RewriteRule .? - [E=__ROUTING_host_2:1] | ||
94 | |||
95 | # route3 | ||
96 | RewriteCond %{ENV:__ROUTING_host_2} =1 | ||
97 | RewriteCond %{REQUEST_URI} ^/c2/route3$ | ||
98 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:route3] | ||
99 | |||
100 | RewriteCond %{HTTP:Host} ^a\.example\.com$ | ||
101 | RewriteRule .? - [E=__ROUTING_host_3:1] | ||
102 | |||
103 | # route4 | ||
104 | RewriteCond %{ENV:__ROUTING_host_3} =1 | ||
105 | RewriteCond %{REQUEST_URI} ^/route4$ | ||
106 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:route4] | ||
107 | |||
108 | RewriteCond %{HTTP:Host} ^c\.example\.com$ | ||
109 | RewriteRule .? - [E=__ROUTING_host_4:1] | ||
110 | |||
111 | # route5 | ||
112 | RewriteCond %{ENV:__ROUTING_host_4} =1 | ||
113 | RewriteCond %{REQUEST_URI} ^/route5$ | ||
114 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:route5] | ||
115 | |||
116 | # route6 | ||
117 | RewriteCond %{REQUEST_URI} ^/route6$ | ||
118 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:route6] | ||
119 | |||
120 | RewriteCond %{HTTP:Host} ^([^\.]++)\.example\.com$ | ||
121 | RewriteRule .? - [E=__ROUTING_host_5:1,E=__ROUTING_host_5_var1:%1] | ||
122 | |||
123 | # route11 | ||
124 | RewriteCond %{ENV:__ROUTING_host_5} =1 | ||
125 | RewriteCond %{REQUEST_URI} ^/route11$ | ||
126 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:route11,E=_ROUTING_param_var1:%{ENV:__ROUTING_host_5_var1}] | ||
127 | |||
128 | # route12 | ||
129 | RewriteCond %{ENV:__ROUTING_host_5} =1 | ||
130 | RewriteCond %{REQUEST_URI} ^/route12$ | ||
131 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:route12,E=_ROUTING_param_var1:%{ENV:__ROUTING_host_5_var1},E=_ROUTING_default_var1:val] | ||
132 | |||
133 | # route13 | ||
134 | RewriteCond %{ENV:__ROUTING_host_5} =1 | ||
135 | RewriteCond %{REQUEST_URI} ^/route13/([^/]++)$ | ||
136 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:route13,E=_ROUTING_param_var1:%{ENV:__ROUTING_host_5_var1},E=_ROUTING_param_name:%1] | ||
137 | |||
138 | # route14 | ||
139 | RewriteCond %{ENV:__ROUTING_host_5} =1 | ||
140 | RewriteCond %{REQUEST_URI} ^/route14/([^/]++)$ | ||
141 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:route14,E=_ROUTING_param_var1:%{ENV:__ROUTING_host_5_var1},E=_ROUTING_param_name:%1,E=_ROUTING_default_var1:val] | ||
142 | |||
143 | RewriteCond %{HTTP:Host} ^c\.example\.com$ | ||
144 | RewriteRule .? - [E=__ROUTING_host_6:1] | ||
145 | |||
146 | # route15 | ||
147 | RewriteCond %{ENV:__ROUTING_host_6} =1 | ||
148 | RewriteCond %{REQUEST_URI} ^/route15/([^/]++)$ | ||
149 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:route15,E=_ROUTING_param_name:%1] | ||
150 | |||
151 | # route16 | ||
152 | RewriteCond %{REQUEST_URI} ^/route16/([^/]++)$ | ||
153 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:route16,E=_ROUTING_param_name:%1,E=_ROUTING_default_var1:val] | ||
154 | |||
155 | # route17 | ||
156 | RewriteCond %{REQUEST_URI} ^/route17$ | ||
157 | RewriteRule .* app.php [QSA,L,E=_ROUTING_route:route17] | ||
158 | |||
159 | # 405 Method Not Allowed | ||
160 | RewriteCond %{ENV:_ROUTING__allow_GET} =1 [OR] | ||
161 | RewriteCond %{ENV:_ROUTING__allow_HEAD} =1 [OR] | ||
162 | RewriteCond %{ENV:_ROUTING__allow_POST} =1 | ||
163 | RewriteRule .* app.php [QSA,L] | ||
diff --git a/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php b/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php new file mode 100644 index 00000000..e5f7665c --- /dev/null +++ b/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher1.php | |||
@@ -0,0 +1,310 @@ | |||
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 | * ProjectUrlMatcher | ||
9 | * | ||
10 | * This class has been auto-generated | ||
11 | * by the Symfony Routing Component. | ||
12 | */ | ||
13 | class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher | ||
14 | { | ||
15 | /** | ||
16 | * Constructor. | ||
17 | */ | ||
18 | public function __construct(RequestContext $context) | ||
19 | { | ||
20 | $this->context = $context; | ||
21 | } | ||
22 | |||
23 | public function match($pathinfo) | ||
24 | { | ||
25 | $allow = array(); | ||
26 | $pathinfo = rawurldecode($pathinfo); | ||
27 | |||
28 | // foo | ||
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',)); | ||
31 | } | ||
32 | |||
33 | if (0 === strpos($pathinfo, '/bar')) { | ||
34 | // 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')); | ||
38 | goto not_bar; | ||
39 | } | ||
40 | |||
41 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar')), array ()); | ||
42 | } | ||
43 | not_bar: | ||
44 | |||
45 | // barhead | ||
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')); | ||
49 | goto not_barhead; | ||
50 | } | ||
51 | |||
52 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array ()); | ||
53 | } | ||
54 | not_barhead: | ||
55 | |||
56 | } | ||
57 | |||
58 | if (0 === strpos($pathinfo, '/test')) { | ||
59 | if (0 === strpos($pathinfo, '/test/baz')) { | ||
60 | // baz | ||
61 | if ($pathinfo === '/test/baz') { | ||
62 | return array('_route' => 'baz'); | ||
63 | } | ||
64 | |||
65 | // baz2 | ||
66 | if ($pathinfo === '/test/baz.html') { | ||
67 | return array('_route' => 'baz2'); | ||
68 | } | ||
69 | |||
70 | // baz3 | ||
71 | if ($pathinfo === '/test/baz3/') { | ||
72 | return array('_route' => 'baz3'); | ||
73 | } | ||
74 | |||
75 | } | ||
76 | |||
77 | // baz4 | ||
78 | if (preg_match('#^/test/(?P<foo>[^/]++)/$#s', $pathinfo, $matches)) { | ||
79 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz4')), array ()); | ||
80 | } | ||
81 | |||
82 | // baz5 | ||
83 | if (preg_match('#^/test/(?P<foo>[^/]++)/$#s', $pathinfo, $matches)) { | ||
84 | if ($this->context->getMethod() != 'POST') { | ||
85 | $allow[] = 'POST'; | ||
86 | goto not_baz5; | ||
87 | } | ||
88 | |||
89 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz5')), array ()); | ||
90 | } | ||
91 | not_baz5: | ||
92 | |||
93 | // baz.baz6 | ||
94 | if (preg_match('#^/test/(?P<foo>[^/]++)/$#s', $pathinfo, $matches)) { | ||
95 | if ($this->context->getMethod() != 'PUT') { | ||
96 | $allow[] = 'PUT'; | ||
97 | goto not_bazbaz6; | ||
98 | } | ||
99 | |||
100 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array ()); | ||
101 | } | ||
102 | not_bazbaz6: | ||
103 | |||
104 | } | ||
105 | |||
106 | // foofoo | ||
107 | if ($pathinfo === '/foofoo') { | ||
108 | return array ( 'def' => 'test', '_route' => 'foofoo',); | ||
109 | } | ||
110 | |||
111 | // quoter | ||
112 | if (preg_match('#^/(?P<quoter>[\']+)$#s', $pathinfo, $matches)) { | ||
113 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'quoter')), array ()); | ||
114 | } | ||
115 | |||
116 | // space | ||
117 | if ($pathinfo === '/spa ce') { | ||
118 | return array('_route' => 'space'); | ||
119 | } | ||
120 | |||
121 | if (0 === strpos($pathinfo, '/a')) { | ||
122 | if (0 === strpos($pathinfo, '/a/b\'b')) { | ||
123 | // foo1 | ||
124 | if (preg_match('#^/a/b\'b/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) { | ||
125 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo1')), array ()); | ||
126 | } | ||
127 | |||
128 | // bar1 | ||
129 | if (preg_match('#^/a/b\'b/(?P<bar>[^/]++)$#s', $pathinfo, $matches)) { | ||
130 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar1')), array ()); | ||
131 | } | ||
132 | |||
133 | } | ||
134 | |||
135 | // overridden | ||
136 | if (preg_match('#^/a/(?P<var>.*)$#s', $pathinfo, $matches)) { | ||
137 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'overridden')), array ()); | ||
138 | } | ||
139 | |||
140 | if (0 === strpos($pathinfo, '/a/b\'b')) { | ||
141 | // foo2 | ||
142 | if (preg_match('#^/a/b\'b/(?P<foo1>[^/]++)$#s', $pathinfo, $matches)) { | ||
143 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo2')), array ()); | ||
144 | } | ||
145 | |||
146 | // bar2 | ||
147 | if (preg_match('#^/a/b\'b/(?P<bar1>[^/]++)$#s', $pathinfo, $matches)) { | ||
148 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar2')), array ()); | ||
149 | } | ||
150 | |||
151 | } | ||
152 | |||
153 | } | ||
154 | |||
155 | if (0 === strpos($pathinfo, '/multi')) { | ||
156 | // helloWorld | ||
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!',)); | ||
159 | } | ||
160 | |||
161 | // overridden2 | ||
162 | if ($pathinfo === '/multi/new') { | ||
163 | return array('_route' => 'overridden2'); | ||
164 | } | ||
165 | |||
166 | // hey | ||
167 | if ($pathinfo === '/multi/hey/') { | ||
168 | return array('_route' => 'hey'); | ||
169 | } | ||
170 | |||
171 | } | ||
172 | |||
173 | // foo3 | ||
174 | if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) { | ||
175 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo3')), array ()); | ||
176 | } | ||
177 | |||
178 | // bar3 | ||
179 | if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<bar>[^/]++)$#s', $pathinfo, $matches)) { | ||
180 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar3')), array ()); | ||
181 | } | ||
182 | |||
183 | if (0 === strpos($pathinfo, '/aba')) { | ||
184 | // ababa | ||
185 | if ($pathinfo === '/ababa') { | ||
186 | return array('_route' => 'ababa'); | ||
187 | } | ||
188 | |||
189 | // foo4 | ||
190 | if (preg_match('#^/aba/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) { | ||
191 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo4')), array ()); | ||
192 | } | ||
193 | |||
194 | } | ||
195 | |||
196 | $host = $this->context->getHost(); | ||
197 | |||
198 | if (preg_match('#^a\\.example\\.com$#s', $host, $hostMatches)) { | ||
199 | // route1 | ||
200 | if ($pathinfo === '/route1') { | ||
201 | return array('_route' => 'route1'); | ||
202 | } | ||
203 | |||
204 | // route2 | ||
205 | if ($pathinfo === '/c2/route2') { | ||
206 | return array('_route' => 'route2'); | ||
207 | } | ||
208 | |||
209 | } | ||
210 | |||
211 | if (preg_match('#^b\\.example\\.com$#s', $host, $hostMatches)) { | ||
212 | // route3 | ||
213 | if ($pathinfo === '/c2/route3') { | ||
214 | return array('_route' => 'route3'); | ||
215 | } | ||
216 | |||
217 | } | ||
218 | |||
219 | if (preg_match('#^a\\.example\\.com$#s', $host, $hostMatches)) { | ||
220 | // route4 | ||
221 | if ($pathinfo === '/route4') { | ||
222 | return array('_route' => 'route4'); | ||
223 | } | ||
224 | |||
225 | } | ||
226 | |||
227 | if (preg_match('#^c\\.example\\.com$#s', $host, $hostMatches)) { | ||
228 | // route5 | ||
229 | if ($pathinfo === '/route5') { | ||
230 | return array('_route' => 'route5'); | ||
231 | } | ||
232 | |||
233 | } | ||
234 | |||
235 | // route6 | ||
236 | if ($pathinfo === '/route6') { | ||
237 | return array('_route' => 'route6'); | ||
238 | } | ||
239 | |||
240 | if (preg_match('#^(?P<var1>[^\\.]++)\\.example\\.com$#s', $host, $hostMatches)) { | ||
241 | if (0 === strpos($pathinfo, '/route1')) { | ||
242 | // route11 | ||
243 | if ($pathinfo === '/route11') { | ||
244 | return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route11')), array ()); | ||
245 | } | ||
246 | |||
247 | // route12 | ||
248 | if ($pathinfo === '/route12') { | ||
249 | return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route12')), array ( 'var1' => 'val',)); | ||
250 | } | ||
251 | |||
252 | // route13 | ||
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 ()); | ||
255 | } | ||
256 | |||
257 | // route14 | ||
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',)); | ||
260 | } | ||
261 | |||
262 | } | ||
263 | |||
264 | } | ||
265 | |||
266 | if (preg_match('#^c\\.example\\.com$#s', $host, $hostMatches)) { | ||
267 | // route15 | ||
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 ()); | ||
270 | } | ||
271 | |||
272 | } | ||
273 | |||
274 | if (0 === strpos($pathinfo, '/route1')) { | ||
275 | // route16 | ||
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',)); | ||
278 | } | ||
279 | |||
280 | // route17 | ||
281 | if ($pathinfo === '/route17') { | ||
282 | return array('_route' => 'route17'); | ||
283 | } | ||
284 | |||
285 | } | ||
286 | |||
287 | if (0 === strpos($pathinfo, '/a')) { | ||
288 | // a | ||
289 | if ($pathinfo === '/a/a...') { | ||
290 | return array('_route' => 'a'); | ||
291 | } | ||
292 | |||
293 | if (0 === strpos($pathinfo, '/a/b')) { | ||
294 | // b | ||
295 | if (preg_match('#^/a/b/(?P<var>[^/]++)$#s', $pathinfo, $matches)) { | ||
296 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'b')), array ()); | ||
297 | } | ||
298 | |||
299 | // c | ||
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 ()); | ||
302 | } | ||
303 | |||
304 | } | ||
305 | |||
306 | } | ||
307 | |||
308 | throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException(); | ||
309 | } | ||
310 | } | ||
diff --git a/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.apache b/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.apache new file mode 100644 index 00000000..309f2ff0 --- /dev/null +++ b/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.apache | |||
@@ -0,0 +1,7 @@ | |||
1 | # skip "real" requests | ||
2 | RewriteCond %{REQUEST_FILENAME} -f | ||
3 | RewriteRule .* - [QSA,L] | ||
4 | |||
5 | # foo | ||
6 | RewriteCond %{REQUEST_URI} ^/foo$ | ||
7 | RewriteRule .* ap\ p_d\ ev.php [QSA,L,E=_ROUTING_route:foo] | ||
diff --git a/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php b/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php new file mode 100644 index 00000000..ad157909 --- /dev/null +++ b/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher2.php | |||
@@ -0,0 +1,340 @@ | |||
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 | * ProjectUrlMatcher | ||
9 | * | ||
10 | * This class has been auto-generated | ||
11 | * by the Symfony Routing Component. | ||
12 | */ | ||
13 | class ProjectUrlMatcher extends Symfony\Component\Routing\Tests\Fixtures\RedirectableUrlMatcher | ||
14 | { | ||
15 | /** | ||
16 | * Constructor. | ||
17 | */ | ||
18 | public function __construct(RequestContext $context) | ||
19 | { | ||
20 | $this->context = $context; | ||
21 | } | ||
22 | |||
23 | public function match($pathinfo) | ||
24 | { | ||
25 | $allow = array(); | ||
26 | $pathinfo = rawurldecode($pathinfo); | ||
27 | |||
28 | // foo | ||
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',)); | ||
31 | } | ||
32 | |||
33 | if (0 === strpos($pathinfo, '/bar')) { | ||
34 | // 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')); | ||
38 | goto not_bar; | ||
39 | } | ||
40 | |||
41 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar')), array ()); | ||
42 | } | ||
43 | not_bar: | ||
44 | |||
45 | // barhead | ||
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')); | ||
49 | goto not_barhead; | ||
50 | } | ||
51 | |||
52 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'barhead')), array ()); | ||
53 | } | ||
54 | not_barhead: | ||
55 | |||
56 | } | ||
57 | |||
58 | if (0 === strpos($pathinfo, '/test')) { | ||
59 | if (0 === strpos($pathinfo, '/test/baz')) { | ||
60 | // baz | ||
61 | if ($pathinfo === '/test/baz') { | ||
62 | return array('_route' => 'baz'); | ||
63 | } | ||
64 | |||
65 | // baz2 | ||
66 | if ($pathinfo === '/test/baz.html') { | ||
67 | return array('_route' => 'baz2'); | ||
68 | } | ||
69 | |||
70 | // baz3 | ||
71 | if (rtrim($pathinfo, '/') === '/test/baz3') { | ||
72 | if (substr($pathinfo, -1) !== '/') { | ||
73 | return $this->redirect($pathinfo.'/', 'baz3'); | ||
74 | } | ||
75 | |||
76 | return array('_route' => 'baz3'); | ||
77 | } | ||
78 | |||
79 | } | ||
80 | |||
81 | // baz4 | ||
82 | if (preg_match('#^/test/(?P<foo>[^/]++)/?$#s', $pathinfo, $matches)) { | ||
83 | if (substr($pathinfo, -1) !== '/') { | ||
84 | return $this->redirect($pathinfo.'/', 'baz4'); | ||
85 | } | ||
86 | |||
87 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz4')), array ()); | ||
88 | } | ||
89 | |||
90 | // baz5 | ||
91 | if (preg_match('#^/test/(?P<foo>[^/]++)/$#s', $pathinfo, $matches)) { | ||
92 | if ($this->context->getMethod() != 'POST') { | ||
93 | $allow[] = 'POST'; | ||
94 | goto not_baz5; | ||
95 | } | ||
96 | |||
97 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz5')), array ()); | ||
98 | } | ||
99 | not_baz5: | ||
100 | |||
101 | // baz.baz6 | ||
102 | if (preg_match('#^/test/(?P<foo>[^/]++)/$#s', $pathinfo, $matches)) { | ||
103 | if ($this->context->getMethod() != 'PUT') { | ||
104 | $allow[] = 'PUT'; | ||
105 | goto not_bazbaz6; | ||
106 | } | ||
107 | |||
108 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'baz.baz6')), array ()); | ||
109 | } | ||
110 | not_bazbaz6: | ||
111 | |||
112 | } | ||
113 | |||
114 | // foofoo | ||
115 | if ($pathinfo === '/foofoo') { | ||
116 | return array ( 'def' => 'test', '_route' => 'foofoo',); | ||
117 | } | ||
118 | |||
119 | // quoter | ||
120 | if (preg_match('#^/(?P<quoter>[\']+)$#s', $pathinfo, $matches)) { | ||
121 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'quoter')), array ()); | ||
122 | } | ||
123 | |||
124 | // space | ||
125 | if ($pathinfo === '/spa ce') { | ||
126 | return array('_route' => 'space'); | ||
127 | } | ||
128 | |||
129 | if (0 === strpos($pathinfo, '/a')) { | ||
130 | if (0 === strpos($pathinfo, '/a/b\'b')) { | ||
131 | // foo1 | ||
132 | if (preg_match('#^/a/b\'b/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) { | ||
133 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo1')), array ()); | ||
134 | } | ||
135 | |||
136 | // bar1 | ||
137 | if (preg_match('#^/a/b\'b/(?P<bar>[^/]++)$#s', $pathinfo, $matches)) { | ||
138 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar1')), array ()); | ||
139 | } | ||
140 | |||
141 | } | ||
142 | |||
143 | // overridden | ||
144 | if (preg_match('#^/a/(?P<var>.*)$#s', $pathinfo, $matches)) { | ||
145 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'overridden')), array ()); | ||
146 | } | ||
147 | |||
148 | if (0 === strpos($pathinfo, '/a/b\'b')) { | ||
149 | // foo2 | ||
150 | if (preg_match('#^/a/b\'b/(?P<foo1>[^/]++)$#s', $pathinfo, $matches)) { | ||
151 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo2')), array ()); | ||
152 | } | ||
153 | |||
154 | // bar2 | ||
155 | if (preg_match('#^/a/b\'b/(?P<bar1>[^/]++)$#s', $pathinfo, $matches)) { | ||
156 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar2')), array ()); | ||
157 | } | ||
158 | |||
159 | } | ||
160 | |||
161 | } | ||
162 | |||
163 | if (0 === strpos($pathinfo, '/multi')) { | ||
164 | // helloWorld | ||
165 | if (0 === strpos($pathinfo, '/multi/hello') && preg_match('#^/multi/hello(?:/(?P<who>[^/]++))?$#s', $pathinfo, $matches)) { | ||
166 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'helloWorld')), array ( 'who' => 'World!',)); | ||
167 | } | ||
168 | |||
169 | // overridden2 | ||
170 | if ($pathinfo === '/multi/new') { | ||
171 | return array('_route' => 'overridden2'); | ||
172 | } | ||
173 | |||
174 | // hey | ||
175 | if (rtrim($pathinfo, '/') === '/multi/hey') { | ||
176 | if (substr($pathinfo, -1) !== '/') { | ||
177 | return $this->redirect($pathinfo.'/', 'hey'); | ||
178 | } | ||
179 | |||
180 | return array('_route' => 'hey'); | ||
181 | } | ||
182 | |||
183 | } | ||
184 | |||
185 | // foo3 | ||
186 | if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) { | ||
187 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo3')), array ()); | ||
188 | } | ||
189 | |||
190 | // bar3 | ||
191 | if (preg_match('#^/(?P<_locale>[^/]++)/b/(?P<bar>[^/]++)$#s', $pathinfo, $matches)) { | ||
192 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'bar3')), array ()); | ||
193 | } | ||
194 | |||
195 | if (0 === strpos($pathinfo, '/aba')) { | ||
196 | // ababa | ||
197 | if ($pathinfo === '/ababa') { | ||
198 | return array('_route' => 'ababa'); | ||
199 | } | ||
200 | |||
201 | // foo4 | ||
202 | if (preg_match('#^/aba/(?P<foo>[^/]++)$#s', $pathinfo, $matches)) { | ||
203 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'foo4')), array ()); | ||
204 | } | ||
205 | |||
206 | } | ||
207 | |||
208 | $host = $this->context->getHost(); | ||
209 | |||
210 | if (preg_match('#^a\\.example\\.com$#s', $host, $hostMatches)) { | ||
211 | // route1 | ||
212 | if ($pathinfo === '/route1') { | ||
213 | return array('_route' => 'route1'); | ||
214 | } | ||
215 | |||
216 | // route2 | ||
217 | if ($pathinfo === '/c2/route2') { | ||
218 | return array('_route' => 'route2'); | ||
219 | } | ||
220 | |||
221 | } | ||
222 | |||
223 | if (preg_match('#^b\\.example\\.com$#s', $host, $hostMatches)) { | ||
224 | // route3 | ||
225 | if ($pathinfo === '/c2/route3') { | ||
226 | return array('_route' => 'route3'); | ||
227 | } | ||
228 | |||
229 | } | ||
230 | |||
231 | if (preg_match('#^a\\.example\\.com$#s', $host, $hostMatches)) { | ||
232 | // route4 | ||
233 | if ($pathinfo === '/route4') { | ||
234 | return array('_route' => 'route4'); | ||
235 | } | ||
236 | |||
237 | } | ||
238 | |||
239 | if (preg_match('#^c\\.example\\.com$#s', $host, $hostMatches)) { | ||
240 | // route5 | ||
241 | if ($pathinfo === '/route5') { | ||
242 | return array('_route' => 'route5'); | ||
243 | } | ||
244 | |||
245 | } | ||
246 | |||
247 | // route6 | ||
248 | if ($pathinfo === '/route6') { | ||
249 | return array('_route' => 'route6'); | ||
250 | } | ||
251 | |||
252 | if (preg_match('#^(?P<var1>[^\\.]++)\\.example\\.com$#s', $host, $hostMatches)) { | ||
253 | if (0 === strpos($pathinfo, '/route1')) { | ||
254 | // route11 | ||
255 | if ($pathinfo === '/route11') { | ||
256 | return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route11')), array ()); | ||
257 | } | ||
258 | |||
259 | // route12 | ||
260 | if ($pathinfo === '/route12') { | ||
261 | return $this->mergeDefaults(array_replace($hostMatches, array('_route' => 'route12')), array ( 'var1' => 'val',)); | ||
262 | } | ||
263 | |||
264 | // route13 | ||
265 | if (0 === strpos($pathinfo, '/route13') && preg_match('#^/route13/(?P<name>[^/]++)$#s', $pathinfo, $matches)) { | ||
266 | return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route13')), array ()); | ||
267 | } | ||
268 | |||
269 | // route14 | ||
270 | if (0 === strpos($pathinfo, '/route14') && preg_match('#^/route14/(?P<name>[^/]++)$#s', $pathinfo, $matches)) { | ||
271 | return $this->mergeDefaults(array_replace($hostMatches, $matches, array('_route' => 'route14')), array ( 'var1' => 'val',)); | ||
272 | } | ||
273 | |||
274 | } | ||
275 | |||
276 | } | ||
277 | |||
278 | if (preg_match('#^c\\.example\\.com$#s', $host, $hostMatches)) { | ||
279 | // route15 | ||
280 | if (0 === strpos($pathinfo, '/route15') && preg_match('#^/route15/(?P<name>[^/]++)$#s', $pathinfo, $matches)) { | ||
281 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'route15')), array ()); | ||
282 | } | ||
283 | |||
284 | } | ||
285 | |||
286 | if (0 === strpos($pathinfo, '/route1')) { | ||
287 | // route16 | ||
288 | if (0 === strpos($pathinfo, '/route16') && preg_match('#^/route16/(?P<name>[^/]++)$#s', $pathinfo, $matches)) { | ||
289 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'route16')), array ( 'var1' => 'val',)); | ||
290 | } | ||
291 | |||
292 | // route17 | ||
293 | if ($pathinfo === '/route17') { | ||
294 | return array('_route' => 'route17'); | ||
295 | } | ||
296 | |||
297 | } | ||
298 | |||
299 | if (0 === strpos($pathinfo, '/a')) { | ||
300 | // a | ||
301 | if ($pathinfo === '/a/a...') { | ||
302 | return array('_route' => 'a'); | ||
303 | } | ||
304 | |||
305 | if (0 === strpos($pathinfo, '/a/b')) { | ||
306 | // b | ||
307 | if (preg_match('#^/a/b/(?P<var>[^/]++)$#s', $pathinfo, $matches)) { | ||
308 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'b')), array ()); | ||
309 | } | ||
310 | |||
311 | // c | ||
312 | if (0 === strpos($pathinfo, '/a/b/c') && preg_match('#^/a/b/c/(?P<var>[^/]++)$#s', $pathinfo, $matches)) { | ||
313 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'c')), array ()); | ||
314 | } | ||
315 | |||
316 | } | ||
317 | |||
318 | } | ||
319 | |||
320 | // secure | ||
321 | if ($pathinfo === '/secure') { | ||
322 | if ($this->context->getScheme() !== 'https') { | ||
323 | return $this->redirect($pathinfo, 'secure', 'https'); | ||
324 | } | ||
325 | |||
326 | return array('_route' => 'secure'); | ||
327 | } | ||
328 | |||
329 | // nonsecure | ||
330 | if ($pathinfo === '/nonsecure') { | ||
331 | if ($this->context->getScheme() !== 'http') { | ||
332 | return $this->redirect($pathinfo, 'nonsecure', 'http'); | ||
333 | } | ||
334 | |||
335 | return array('_route' => 'nonsecure'); | ||
336 | } | ||
337 | |||
338 | throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException(); | ||
339 | } | ||
340 | } | ||
diff --git a/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php b/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php new file mode 100644 index 00000000..f2f642eb --- /dev/null +++ b/vendor/symfony/routing/Symfony/Component/Routing/Tests/Fixtures/dumper/url_matcher3.php | |||
@@ -0,0 +1,43 @@ | |||
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 | * ProjectUrlMatcher | ||
9 | * | ||
10 | * This class has been auto-generated | ||
11 | * by the Symfony Routing Component. | ||
12 | */ | ||
13 | class ProjectUrlMatcher extends Symfony\Component\Routing\Matcher\UrlMatcher | ||
14 | { | ||
15 | /** | ||
16 | * Constructor. | ||
17 | */ | ||
18 | public function __construct(RequestContext $context) | ||
19 | { | ||
20 | $this->context = $context; | ||
21 | } | ||
22 | |||
23 | public function match($pathinfo) | ||
24 | { | ||
25 | $allow = array(); | ||
26 | $pathinfo = rawurldecode($pathinfo); | ||
27 | |||
28 | if (0 === strpos($pathinfo, '/rootprefix')) { | ||
29 | // static | ||
30 | if ($pathinfo === '/rootprefix/test') { | ||
31 | return array('_route' => 'static'); | ||
32 | } | ||
33 | |||
34 | // dynamic | ||
35 | if (preg_match('#^/rootprefix/(?P<var>[^/]++)$#s', $pathinfo, $matches)) { | ||
36 | return $this->mergeDefaults(array_replace($matches, array('_route' => 'dynamic')), array ()); | ||
37 | } | ||
38 | |||
39 | } | ||
40 | |||
41 | throw 0 < count($allow) ? new MethodNotAllowedException(array_unique($allow)) : new ResourceNotFoundException(); | ||
42 | } | ||
43 | } | ||