Skip to content

HTTPS clone URL

Subversion checkout URL

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