Security update for Core, with self-updated composer
[yaffs-website] / vendor / symfony / routing / CHANGELOG.md
1 CHANGELOG
2 =========
3
4 3.2.0
5 -----
6
7  * Added support for `bool`, `int`, `float`, `string`, `list` and `map` defaults in XML configurations.
8  * Added support for UTF-8 requirements
9   
10 2.8.0
11 -----
12
13  * allowed specifying a directory to recursively load all routing configuration files it contains
14  * Added ObjectRouteLoader and ServiceRouteLoader that allow routes to be loaded
15    by calling a method on an object/service.
16  * [DEPRECATION] Deprecated the hardcoded value for the `$referenceType` argument of the `UrlGeneratorInterface::generate` method.
17    Use the constants defined in the `UrlGeneratorInterface` instead.
18
19    Before:
20
21    ```php
22    $router->generate('blog_show', array('slug' => 'my-blog-post'), true);
23    ```
24
25    After:
26
27    ```php
28    use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
29
30    $router->generate('blog_show', array('slug' => 'my-blog-post'), UrlGeneratorInterface::ABSOLUTE_URL);
31    ```
32
33 2.5.0
34 -----
35
36  * [DEPRECATION] The `ApacheMatcherDumper` and `ApacheUrlMatcher` were deprecated and
37    will be removed in Symfony 3.0, since the performance gains were minimal and
38    it's hard to replicate the behaviour of PHP implementation.
39
40 2.3.0
41 -----
42
43  * added RequestContext::getQueryString()
44
45 2.2.0
46 -----
47
48  * [DEPRECATION] Several route settings have been renamed (the old ones will be removed in 3.0):
49
50     * The `pattern` setting for a route has been deprecated in favor of `path`
51     * The `_scheme` and `_method` requirements have been moved to the `schemes` and `methods` settings
52
53    Before:
54
55    ```yaml
56    article_edit:
57        pattern: /article/{id}
58        requirements: { '_method': 'POST|PUT', '_scheme': 'https', 'id': '\d+' }
59    ```
60
61    ```xml
62    <route id="article_edit" pattern="/article/{id}">
63        <requirement key="_method">POST|PUT</requirement>
64        <requirement key="_scheme">https</requirement>
65        <requirement key="id">\d+</requirement>
66    </route>
67    ```
68
69    ```php
70    $route = new Route();
71    $route->setPattern('/article/{id}');
72    $route->setRequirement('_method', 'POST|PUT');
73    $route->setRequirement('_scheme', 'https');
74    ```
75
76    After:
77
78    ```yaml
79    article_edit:
80        path: /article/{id}
81        methods: [POST, PUT]
82        schemes: https
83        requirements: { 'id': '\d+' }
84    ```
85
86    ```xml
87    <route id="article_edit" pattern="/article/{id}" methods="POST PUT" schemes="https">
88        <requirement key="id">\d+</requirement>
89    </route>
90    ```
91
92    ```php
93    $route = new Route();
94    $route->setPath('/article/{id}');
95    $route->setMethods(array('POST', 'PUT'));
96    $route->setSchemes('https');
97    ```
98
99  * [BC BREAK] RouteCollection does not behave like a tree structure anymore but as
100    a flat array of Routes. So when using PHP to build the RouteCollection, you must
101    make sure to add routes to the sub-collection before adding it to the parent
102    collection (this is not relevant when using YAML or XML for Route definitions).
103
104    Before:
105
106    ```php
107    $rootCollection = new RouteCollection();
108    $subCollection = new RouteCollection();
109    $rootCollection->addCollection($subCollection);
110    $subCollection->add('foo', new Route('/foo'));
111    ```
112
113    After:
114
115    ```php
116    $rootCollection = new RouteCollection();
117    $subCollection = new RouteCollection();
118    $subCollection->add('foo', new Route('/foo'));
119    $rootCollection->addCollection($subCollection);
120    ```
121
122    Also one must call `addCollection` from the bottom to the top hierarchy.
123    So the correct sequence is the following (and not the reverse):
124
125    ```php
126    $childCollection->addCollection($grandchildCollection);
127    $rootCollection->addCollection($childCollection);
128    ```
129
130  * [DEPRECATION] The methods `RouteCollection::getParent()` and `RouteCollection::getRoot()`
131    have been deprecated and will be removed in Symfony 2.3.
132  * [BC BREAK] Misusing the `RouteCollection::addPrefix` method to add defaults, requirements
133    or options without adding a prefix is not supported anymore. So if you called `addPrefix`
134    with an empty prefix or `/` only (both have no relevance), like
135    `addPrefix('', $defaultsArray, $requirementsArray, $optionsArray)`
136    you need to use the new dedicated methods `addDefaults($defaultsArray)`,
137    `addRequirements($requirementsArray)` or `addOptions($optionsArray)` instead.
138  * [DEPRECATION] The `$options` parameter to `RouteCollection::addPrefix()` has been deprecated
139    because adding options has nothing to do with adding a path prefix. If you want to add options
140    to all child routes of a RouteCollection, you can use `addOptions()`.
141  * [DEPRECATION] The method `RouteCollection::getPrefix()` has been deprecated
142    because it suggested that all routes in the collection would have this prefix, which is
143    not necessarily true. On top of that, since there is no tree structure anymore, this method
144    is also useless. Don't worry about performance, prefix optimization for matching is still done
145    in the dumper, which was also improved in 2.2.0 to find even more grouping possibilities.
146  * [DEPRECATION] `RouteCollection::addCollection(RouteCollection $collection)` should now only be
147    used with a single parameter. The other params `$prefix`, `$default`, `$requirements` and `$options`
148    will still work, but have been deprecated. The `addPrefix` method should be used for this
149    use-case instead.
150    Before: `$parentCollection->addCollection($collection, '/prefix', array(...), array(...))`
151    After:
152    ```php
153    $collection->addPrefix('/prefix', array(...), array(...));
154    $parentCollection->addCollection($collection);
155    ```
156  * added support for the method default argument values when defining a @Route
157  * Adjacent placeholders without separator work now, e.g. `/{x}{y}{z}.{_format}`.
158  * Characters that function as separator between placeholders are now whitelisted
159    to fix routes with normal text around a variable, e.g. `/prefix{var}suffix`.
160  * [BC BREAK] The default requirement of a variable has been changed slightly.
161    Previously it disallowed the previous and the next char around a variable. Now
162    it disallows the slash (`/`) and the next char. Using the previous char added
163    no value and was problematic because the route `/index.{_format}` would be
164    matched by `/index.ht/ml`.
165  * The default requirement now uses possessive quantifiers when possible which
166    improves matching performance by up to 20% because it prevents backtracking
167    when it's not needed.
168  * The ConfigurableRequirementsInterface can now also be used to disable the requirements
169    check on URL generation completely by calling `setStrictRequirements(null)`. It
170    improves performance in production environment as you should know that params always
171    pass the requirements (otherwise it would break your link anyway).
172  * There is no restriction on the route name anymore. So non-alphanumeric characters
173    are now also allowed.
174  * [BC BREAK] `RouteCompilerInterface::compile(Route $route)` was made static
175    (only relevant if you implemented your own RouteCompiler).
176  * Added possibility to generate relative paths and network paths in the UrlGenerator, e.g.
177    "../parent-file" and "//example.com/dir/file". The third parameter in
178    `UrlGeneratorInterface::generate($name, $parameters = array(), $referenceType = self::ABSOLUTE_PATH)`
179    now accepts more values and you should use the constants defined in `UrlGeneratorInterface` for
180    claritiy. The old method calls with a Boolean parameter will continue to work because they
181    equal the signature using the constants.
182
183 2.1.0
184 -----
185
186  * added RequestMatcherInterface
187  * added RequestContext::fromRequest()
188  * the UrlMatcher does not throw a \LogicException anymore when the required
189    scheme is not the current one
190  * added TraceableUrlMatcher
191  * added the possibility to define options, default values and requirements
192    for placeholders in prefix, including imported routes
193  * added RouterInterface::getRouteCollection
194  * [BC BREAK] the UrlMatcher urldecodes the route parameters only once, they
195    were decoded twice before. Note that the `urldecode()` calls have been
196    changed for a single `rawurldecode()` in order to support `+` for input
197    paths.
198  * added RouteCollection::getRoot method to retrieve the root of a
199    RouteCollection tree
200  * [BC BREAK] made RouteCollection::setParent private which could not have
201    been used anyway without creating inconsistencies
202  * [BC BREAK] RouteCollection::remove also removes a route from parent
203    collections (not only from its children)
204  * added ConfigurableRequirementsInterface that allows to disable exceptions
205    (and generate empty URLs instead) when generating a route with an invalid
206    parameter value