| 3 |
liveuser |
1 |
CHANGELOG
|
|
|
2 |
=========
|
|
|
3 |
|
|
|
4 |
5.1.0
|
|
|
5 |
-----
|
|
|
6 |
|
|
|
7 |
* added the protected method `PhpFileLoader::callConfigurator()` as extension point to ease custom routing configuration
|
|
|
8 |
* deprecated `RouteCollectionBuilder` in favor of `RoutingConfigurator`.
|
|
|
9 |
* added "priority" option to annotated routes
|
|
|
10 |
* added argument `$priority` to `RouteCollection::add()`
|
|
|
11 |
* deprecated the `RouteCompiler::REGEX_DELIMITER` constant
|
|
|
12 |
* added `ExpressionLanguageProvider` to expose extra functions to route conditions
|
|
|
13 |
* added support for a `stateless` keyword for configuring route stateless in PHP, YAML and XML configurations.
|
|
|
14 |
* added the "hosts" option to be able to configure the host per locale.
|
|
|
15 |
* added `RequestContext::fromUri()` to ease building the default context
|
|
|
16 |
|
|
|
17 |
5.0.0
|
|
|
18 |
-----
|
|
|
19 |
|
|
|
20 |
* removed `PhpGeneratorDumper` and `PhpMatcherDumper`
|
|
|
21 |
* removed `generator_base_class`, `generator_cache_class`, `matcher_base_class` and `matcher_cache_class` router options
|
|
|
22 |
* `Serializable` implementing methods for `Route` and `CompiledRoute` are final
|
|
|
23 |
* removed referencing service route loaders with a single colon
|
|
|
24 |
* Removed `ServiceRouterLoader` and `ObjectRouteLoader`.
|
|
|
25 |
|
|
|
26 |
4.4.0
|
|
|
27 |
-----
|
|
|
28 |
|
|
|
29 |
* Deprecated `ServiceRouterLoader` in favor of `ContainerLoader`.
|
|
|
30 |
* Deprecated `ObjectRouteLoader` in favor of `ObjectLoader`.
|
|
|
31 |
* Added a way to exclude patterns of resources from being imported by the `import()` method
|
|
|
32 |
|
|
|
33 |
4.3.0
|
|
|
34 |
-----
|
|
|
35 |
|
|
|
36 |
* added `CompiledUrlMatcher` and `CompiledUrlMatcherDumper`
|
|
|
37 |
* added `CompiledUrlGenerator` and `CompiledUrlGeneratorDumper`
|
|
|
38 |
* deprecated `PhpGeneratorDumper` and `PhpMatcherDumper`
|
|
|
39 |
* deprecated `generator_base_class`, `generator_cache_class`, `matcher_base_class` and `matcher_cache_class` router options
|
|
|
40 |
* `Serializable` implementing methods for `Route` and `CompiledRoute` are marked as `@internal` and `@final`.
|
|
|
41 |
Instead of overwriting them, use `__serialize` and `__unserialize` as extension points which are forward compatible
|
|
|
42 |
with the new serialization methods in PHP 7.4.
|
|
|
43 |
* exposed `utf8` Route option, defaults "locale" and "format" in configuration loaders and configurators
|
|
|
44 |
* added support for invokable service route loaders
|
|
|
45 |
|
|
|
46 |
4.2.0
|
|
|
47 |
-----
|
|
|
48 |
|
|
|
49 |
* added fallback to cultureless locale for internationalized routes
|
|
|
50 |
|
|
|
51 |
4.0.0
|
|
|
52 |
-----
|
|
|
53 |
|
|
|
54 |
* dropped support for using UTF-8 route patterns without using the `utf8` option
|
|
|
55 |
* dropped support for using UTF-8 route requirements without using the `utf8` option
|
|
|
56 |
|
|
|
57 |
3.4.0
|
|
|
58 |
-----
|
|
|
59 |
|
|
|
60 |
* Added `NoConfigurationException`.
|
|
|
61 |
* Added the possibility to define a prefix for all routes of a controller via @Route(name="prefix_")
|
|
|
62 |
* Added support for prioritized routing loaders.
|
|
|
63 |
* Add matched and default parameters to redirect responses
|
|
|
64 |
* Added support for a `controller` keyword for configuring route controllers in YAML and XML configurations.
|
|
|
65 |
|
|
|
66 |
3.3.0
|
|
|
67 |
-----
|
|
|
68 |
|
|
|
69 |
* [DEPRECATION] Class parameters have been deprecated and will be removed in 4.0.
|
|
|
70 |
* router.options.generator_class
|
|
|
71 |
* router.options.generator_base_class
|
|
|
72 |
* router.options.generator_dumper_class
|
|
|
73 |
* router.options.matcher_class
|
|
|
74 |
* router.options.matcher_base_class
|
|
|
75 |
* router.options.matcher_dumper_class
|
|
|
76 |
* router.options.matcher.cache_class
|
|
|
77 |
* router.options.generator.cache_class
|
|
|
78 |
|
|
|
79 |
3.2.0
|
|
|
80 |
-----
|
|
|
81 |
|
|
|
82 |
* Added support for `bool`, `int`, `float`, `string`, `list` and `map` defaults in XML configurations.
|
|
|
83 |
* Added support for UTF-8 requirements
|
|
|
84 |
|
|
|
85 |
2.8.0
|
|
|
86 |
-----
|
|
|
87 |
|
|
|
88 |
* allowed specifying a directory to recursively load all routing configuration files it contains
|
|
|
89 |
* Added ObjectRouteLoader and ServiceRouteLoader that allow routes to be loaded
|
|
|
90 |
by calling a method on an object/service.
|
|
|
91 |
* [DEPRECATION] Deprecated the hardcoded value for the `$referenceType` argument of the `UrlGeneratorInterface::generate` method.
|
|
|
92 |
Use the constants defined in the `UrlGeneratorInterface` instead.
|
|
|
93 |
|
|
|
94 |
Before:
|
|
|
95 |
|
|
|
96 |
```php
|
|
|
97 |
$router->generate('blog_show', ['slug' => 'my-blog-post'], true);
|
|
|
98 |
```
|
|
|
99 |
|
|
|
100 |
After:
|
|
|
101 |
|
|
|
102 |
```php
|
|
|
103 |
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
|
|
104 |
|
|
|
105 |
$router->generate('blog_show', ['slug' => 'my-blog-post'], UrlGeneratorInterface::ABSOLUTE_URL);
|
|
|
106 |
```
|
|
|
107 |
|
|
|
108 |
2.5.0
|
|
|
109 |
-----
|
|
|
110 |
|
|
|
111 |
* [DEPRECATION] The `ApacheMatcherDumper` and `ApacheUrlMatcher` were deprecated and
|
|
|
112 |
will be removed in Symfony 3.0, since the performance gains were minimal and
|
|
|
113 |
it's hard to replicate the behavior of PHP implementation.
|
|
|
114 |
|
|
|
115 |
2.3.0
|
|
|
116 |
-----
|
|
|
117 |
|
|
|
118 |
* added RequestContext::getQueryString()
|
|
|
119 |
|
|
|
120 |
2.2.0
|
|
|
121 |
-----
|
|
|
122 |
|
|
|
123 |
* [DEPRECATION] Several route settings have been renamed (the old ones will be removed in 3.0):
|
|
|
124 |
|
|
|
125 |
* The `pattern` setting for a route has been deprecated in favor of `path`
|
|
|
126 |
* The `_scheme` and `_method` requirements have been moved to the `schemes` and `methods` settings
|
|
|
127 |
|
|
|
128 |
Before:
|
|
|
129 |
|
|
|
130 |
```yaml
|
|
|
131 |
article_edit:
|
|
|
132 |
pattern: /article/{id}
|
|
|
133 |
requirements: { '_method': 'POST|PUT', '_scheme': 'https', 'id': '\d+' }
|
|
|
134 |
```
|
|
|
135 |
|
|
|
136 |
```xml
|
|
|
137 |
<route id="article_edit" pattern="/article/{id}">
|
|
|
138 |
<requirement key="_method">POST|PUT</requirement>
|
|
|
139 |
<requirement key="_scheme">https</requirement>
|
|
|
140 |
<requirement key="id">\d+</requirement>
|
|
|
141 |
</route>
|
|
|
142 |
```
|
|
|
143 |
|
|
|
144 |
```php
|
|
|
145 |
$route = new Route();
|
|
|
146 |
$route->setPattern('/article/{id}');
|
|
|
147 |
$route->setRequirement('_method', 'POST|PUT');
|
|
|
148 |
$route->setRequirement('_scheme', 'https');
|
|
|
149 |
```
|
|
|
150 |
|
|
|
151 |
After:
|
|
|
152 |
|
|
|
153 |
```yaml
|
|
|
154 |
article_edit:
|
|
|
155 |
path: /article/{id}
|
|
|
156 |
methods: [POST, PUT]
|
|
|
157 |
schemes: https
|
|
|
158 |
requirements: { 'id': '\d+' }
|
|
|
159 |
```
|
|
|
160 |
|
|
|
161 |
```xml
|
|
|
162 |
<route id="article_edit" pattern="/article/{id}" methods="POST PUT" schemes="https">
|
|
|
163 |
<requirement key="id">\d+</requirement>
|
|
|
164 |
</route>
|
|
|
165 |
```
|
|
|
166 |
|
|
|
167 |
```php
|
|
|
168 |
$route = new Route();
|
|
|
169 |
$route->setPath('/article/{id}');
|
|
|
170 |
$route->setMethods(['POST', 'PUT']);
|
|
|
171 |
$route->setSchemes('https');
|
|
|
172 |
```
|
|
|
173 |
|
|
|
174 |
* [BC BREAK] RouteCollection does not behave like a tree structure anymore but as
|
|
|
175 |
a flat array of Routes. So when using PHP to build the RouteCollection, you must
|
|
|
176 |
make sure to add routes to the sub-collection before adding it to the parent
|
|
|
177 |
collection (this is not relevant when using YAML or XML for Route definitions).
|
|
|
178 |
|
|
|
179 |
Before:
|
|
|
180 |
|
|
|
181 |
```php
|
|
|
182 |
$rootCollection = new RouteCollection();
|
|
|
183 |
$subCollection = new RouteCollection();
|
|
|
184 |
$rootCollection->addCollection($subCollection);
|
|
|
185 |
$subCollection->add('foo', new Route('/foo'));
|
|
|
186 |
```
|
|
|
187 |
|
|
|
188 |
After:
|
|
|
189 |
|
|
|
190 |
```php
|
|
|
191 |
$rootCollection = new RouteCollection();
|
|
|
192 |
$subCollection = new RouteCollection();
|
|
|
193 |
$subCollection->add('foo', new Route('/foo'));
|
|
|
194 |
$rootCollection->addCollection($subCollection);
|
|
|
195 |
```
|
|
|
196 |
|
|
|
197 |
Also one must call `addCollection` from the bottom to the top hierarchy.
|
|
|
198 |
So the correct sequence is the following (and not the reverse):
|
|
|
199 |
|
|
|
200 |
```php
|
|
|
201 |
$childCollection->addCollection($grandchildCollection);
|
|
|
202 |
$rootCollection->addCollection($childCollection);
|
|
|
203 |
```
|
|
|
204 |
|
|
|
205 |
* [DEPRECATION] The methods `RouteCollection::getParent()` and `RouteCollection::getRoot()`
|
|
|
206 |
have been deprecated and will be removed in Symfony 2.3.
|
|
|
207 |
* [BC BREAK] Misusing the `RouteCollection::addPrefix` method to add defaults, requirements
|
|
|
208 |
or options without adding a prefix is not supported anymore. So if you called `addPrefix`
|
|
|
209 |
with an empty prefix or `/` only (both have no relevance), like
|
|
|
210 |
`addPrefix('', $defaultsArray, $requirementsArray, $optionsArray)`
|
|
|
211 |
you need to use the new dedicated methods `addDefaults($defaultsArray)`,
|
|
|
212 |
`addRequirements($requirementsArray)` or `addOptions($optionsArray)` instead.
|
|
|
213 |
* [DEPRECATION] The `$options` parameter to `RouteCollection::addPrefix()` has been deprecated
|
|
|
214 |
because adding options has nothing to do with adding a path prefix. If you want to add options
|
|
|
215 |
to all child routes of a RouteCollection, you can use `addOptions()`.
|
|
|
216 |
* [DEPRECATION] The method `RouteCollection::getPrefix()` has been deprecated
|
|
|
217 |
because it suggested that all routes in the collection would have this prefix, which is
|
|
|
218 |
not necessarily true. On top of that, since there is no tree structure anymore, this method
|
|
|
219 |
is also useless. Don't worry about performance, prefix optimization for matching is still done
|
|
|
220 |
in the dumper, which was also improved in 2.2.0 to find even more grouping possibilities.
|
|
|
221 |
* [DEPRECATION] `RouteCollection::addCollection(RouteCollection $collection)` should now only be
|
|
|
222 |
used with a single parameter. The other params `$prefix`, `$default`, `$requirements` and `$options`
|
|
|
223 |
will still work, but have been deprecated. The `addPrefix` method should be used for this
|
|
|
224 |
use-case instead.
|
|
|
225 |
Before: `$parentCollection->addCollection($collection, '/prefix', [...], [...])`
|
|
|
226 |
After:
|
|
|
227 |
```php
|
|
|
228 |
$collection->addPrefix('/prefix', [...], [...]);
|
|
|
229 |
$parentCollection->addCollection($collection);
|
|
|
230 |
```
|
|
|
231 |
* added support for the method default argument values when defining a @Route
|
|
|
232 |
* Adjacent placeholders without separator work now, e.g. `/{x}{y}{z}.{_format}`.
|
|
|
233 |
* Characters that function as separator between placeholders are now whitelisted
|
|
|
234 |
to fix routes with normal text around a variable, e.g. `/prefix{var}suffix`.
|
|
|
235 |
* [BC BREAK] The default requirement of a variable has been changed slightly.
|
|
|
236 |
Previously it disallowed the previous and the next char around a variable. Now
|
|
|
237 |
it disallows the slash (`/`) and the next char. Using the previous char added
|
|
|
238 |
no value and was problematic because the route `/index.{_format}` would be
|
|
|
239 |
matched by `/index.ht/ml`.
|
|
|
240 |
* The default requirement now uses possessive quantifiers when possible which
|
|
|
241 |
improves matching performance by up to 20% because it prevents backtracking
|
|
|
242 |
when it's not needed.
|
|
|
243 |
* The ConfigurableRequirementsInterface can now also be used to disable the requirements
|
|
|
244 |
check on URL generation completely by calling `setStrictRequirements(null)`. It
|
|
|
245 |
improves performance in production environment as you should know that params always
|
|
|
246 |
pass the requirements (otherwise it would break your link anyway).
|
|
|
247 |
* There is no restriction on the route name anymore. So non-alphanumeric characters
|
|
|
248 |
are now also allowed.
|
|
|
249 |
* [BC BREAK] `RouteCompilerInterface::compile(Route $route)` was made static
|
|
|
250 |
(only relevant if you implemented your own RouteCompiler).
|
|
|
251 |
* Added possibility to generate relative paths and network paths in the UrlGenerator, e.g.
|
|
|
252 |
"../parent-file" and "//example.com/dir/file". The third parameter in
|
|
|
253 |
`UrlGeneratorInterface::generate($name, $parameters = [], $referenceType = self::ABSOLUTE_PATH)`
|
|
|
254 |
now accepts more values and you should use the constants defined in `UrlGeneratorInterface` for
|
|
|
255 |
claritiy. The old method calls with a Boolean parameter will continue to work because they
|
|
|
256 |
equal the signature using the constants.
|
|
|
257 |
|
|
|
258 |
2.1.0
|
|
|
259 |
-----
|
|
|
260 |
|
|
|
261 |
* added RequestMatcherInterface
|
|
|
262 |
* added RequestContext::fromRequest()
|
|
|
263 |
* the UrlMatcher does not throw a \LogicException anymore when the required
|
|
|
264 |
scheme is not the current one
|
|
|
265 |
* added TraceableUrlMatcher
|
|
|
266 |
* added the possibility to define options, default values and requirements
|
|
|
267 |
for placeholders in prefix, including imported routes
|
|
|
268 |
* added RouterInterface::getRouteCollection
|
|
|
269 |
* [BC BREAK] the UrlMatcher urldecodes the route parameters only once, they
|
|
|
270 |
were decoded twice before. Note that the `urldecode()` calls have been
|
|
|
271 |
changed for a single `rawurldecode()` in order to support `+` for input
|
|
|
272 |
paths.
|
|
|
273 |
* added RouteCollection::getRoot method to retrieve the root of a
|
|
|
274 |
RouteCollection tree
|
|
|
275 |
* [BC BREAK] made RouteCollection::setParent private which could not have
|
|
|
276 |
been used anyway without creating inconsistencies
|
|
|
277 |
* [BC BREAK] RouteCollection::remove also removes a route from parent
|
|
|
278 |
collections (not only from its children)
|
|
|
279 |
* added ConfigurableRequirementsInterface that allows to disable exceptions
|
|
|
280 |
(and generate empty URLs instead) when generating a route with an invalid
|
|
|
281 |
parameter value
|