2011-03-28 16:07:05 +01:00
|
|
|
How to update your project?
|
|
|
|
===========================
|
|
|
|
|
|
|
|
This document explains how to upgrade from one Symfony2 PR version to the next
|
|
|
|
one. It only discusses changes that need to be done when using the "public"
|
|
|
|
API of the framework. If you "hack" the core, you should probably follow the
|
|
|
|
timeline closely anyway.
|
|
|
|
|
2011-04-20 12:48:32 +01:00
|
|
|
PR12 to PR13
|
|
|
|
------------
|
|
|
|
|
|
|
|
* Some methods in the DependencyInjection component's ContainerBuilder and
|
|
|
|
Definition classes have been renamed to be more specific and consistent:
|
|
|
|
|
|
|
|
Before:
|
|
|
|
|
|
|
|
$container->remove('my_definition');
|
|
|
|
$definition->setArgument(0, 'foo');
|
|
|
|
|
|
|
|
After:
|
|
|
|
|
|
|
|
$container->removeDefinition('my_definition');
|
|
|
|
$definition->replaceArgument(0, 'foo');
|
2011-04-20 21:20:55 +01:00
|
|
|
|
|
|
|
* In the rememberme configuration, the token_provider key now expects a real
|
|
|
|
service id instead of only a suffix.
|
2011-04-20 12:48:32 +01:00
|
|
|
|
2011-04-13 13:13:04 +01:00
|
|
|
PR11 to PR12
|
|
|
|
------------
|
|
|
|
|
2011-04-19 13:05:08 +01:00
|
|
|
* HttpFoundation\Cookie::getExpire() was renamed to getExpiresTime()
|
|
|
|
|
2011-04-15 09:47:21 +01:00
|
|
|
* XML configurations have been normalized. All tags with only one attribute
|
|
|
|
have been converted to tag content:
|
2011-04-13 13:13:04 +01:00
|
|
|
|
|
|
|
Before:
|
|
|
|
|
|
|
|
<bundle name="MyBundle" />
|
2011-04-15 09:47:21 +01:00
|
|
|
<app:engine id="twig" />
|
|
|
|
<twig:extension id="twig.extension.debug" />
|
2011-04-13 13:13:04 +01:00
|
|
|
|
|
|
|
After:
|
|
|
|
|
|
|
|
<bundle>MyBundle</bundle>
|
2011-04-15 09:47:21 +01:00
|
|
|
<app:engine>twig</app:engine>
|
|
|
|
<twig:extension>twig.extension.debug</twig:extension>
|
2011-04-13 13:13:04 +01:00
|
|
|
|
2011-04-19 11:12:29 +01:00
|
|
|
* Fixes a critical security issue which allowed all users to switch to
|
|
|
|
arbitrary accounts when the SwitchUserListener was activated. Configurations
|
|
|
|
which do not use the SwitchUserListener are not affected.
|
|
|
|
|
2011-04-05 10:42:34 +01:00
|
|
|
PR10 to PR11
|
|
|
|
------------
|
|
|
|
|
|
|
|
* Extension configuration classes should now implement the
|
2011-04-13 13:03:09 +01:00
|
|
|
`Symfony\Component\Config\Definition\ConfigurationInterface` interface. Note
|
|
|
|
that the BC is kept but implementing this interface in your extensions will
|
|
|
|
allow for further developments.
|
|
|
|
|
|
|
|
* The "fingerscrossed" Monolog option has been renamed to "fingers_crossed".
|
2011-04-05 10:42:34 +01:00
|
|
|
|
2011-04-04 10:36:28 +01:00
|
|
|
PR9 to PR10
|
2011-03-31 05:52:18 +01:00
|
|
|
-----------
|
|
|
|
|
2011-04-04 10:36:28 +01:00
|
|
|
* Bundle logical names earned back their `Bundle` suffix:
|
|
|
|
|
|
|
|
*Controllers*: `Blog:Post:show` -> `BlogBundle:Post:show`
|
|
|
|
|
|
|
|
*Templates*: `Blog:Post:show.html.twig` -> `BlogBundle:Post:show.html.twig`
|
|
|
|
|
|
|
|
*Resources*: `@Blog/Resources/config/blog.xml` -> `@BlogBundle/Resources/config/blog.xml`
|
|
|
|
|
|
|
|
*Doctrine*: `$em->find('Blog:Post', $id)` -> `$em->find('BlogBundle:Post', $id)`
|
|
|
|
|
2011-04-04 11:45:31 +01:00
|
|
|
* `ZendBundle` has been replaced by `MonologBundle`. Have a look at the
|
|
|
|
changes made to Symfony SE to see how to upgrade your projects:
|
|
|
|
https://github.com/symfony/symfony-standard/pull/30/files
|
|
|
|
|
2011-04-04 10:44:44 +01:00
|
|
|
* Almost all core bundles parameters have been removed. You should use the
|
|
|
|
settings exposed by the bundle extension configuration instead.
|
|
|
|
|
|
|
|
* Some core bundles service names changed for better consistency.
|
|
|
|
|
2011-03-31 05:52:18 +01:00
|
|
|
* Namespace for validators has changed from `validation` to `assert` (it was
|
|
|
|
announced for PR9 but it was not the case then):
|
|
|
|
|
|
|
|
Before:
|
|
|
|
|
|
|
|
@validation:NotNull
|
|
|
|
|
|
|
|
After:
|
|
|
|
|
|
|
|
@assert:NotNull
|
|
|
|
|
|
|
|
Moreover, the `Assert` prefix used for some constraints has been removed
|
|
|
|
(`AssertTrue` to `True`).
|
|
|
|
|
2011-04-04 10:44:44 +01:00
|
|
|
* `ApplicationTester::getDisplay()` and `CommandTester::getDisplay()` method
|
|
|
|
now return the command exit code
|
|
|
|
|
2011-03-28 16:07:05 +01:00
|
|
|
PR8 to PR9
|
|
|
|
----------
|
|
|
|
|
|
|
|
* `Symfony\Bundle\FrameworkBundle\Util\Filesystem` has been moved to
|
|
|
|
`Symfony\Component\HttpKernel\Util\Filesystem`
|
|
|
|
|
|
|
|
* The `Execute` constraint has been renamed to `Callback`
|
|
|
|
|
|
|
|
* The HTTP exceptions classes signatures have changed:
|
|
|
|
|
2011-03-29 08:28:20 +01:00
|
|
|
Before:
|
|
|
|
|
|
|
|
throw new NotFoundHttpException('Not Found', $message, 0, $e);
|
|
|
|
|
|
|
|
After:
|
|
|
|
|
|
|
|
throw new NotFoundHttpException($message, $e);
|
2011-03-28 16:07:05 +01:00
|
|
|
|
|
|
|
* The RequestMatcher class does not add `^` and `$` anymore to regexp.
|
|
|
|
|
|
|
|
You need to update your security configuration accordingly for instance:
|
|
|
|
|
|
|
|
Before:
|
|
|
|
|
2011-04-06 09:51:28 +01:00
|
|
|
pattern: /_profiler.*
|
|
|
|
pattern: /login
|
2011-03-28 16:07:05 +01:00
|
|
|
|
|
|
|
After:
|
|
|
|
|
2011-04-06 09:51:28 +01:00
|
|
|
pattern: ^/_profiler
|
|
|
|
pattern: ^/login$
|
2011-03-28 16:07:05 +01:00
|
|
|
|
|
|
|
* Global templates under `app/` moved to a new location (old directory did not
|
|
|
|
work anyway):
|
|
|
|
|
|
|
|
Before:
|
2011-03-29 08:28:20 +01:00
|
|
|
|
2011-03-28 16:07:05 +01:00
|
|
|
app/views/base.html.twig
|
|
|
|
app/views/AcmeDemoBundle/base.html.twig
|
|
|
|
|
|
|
|
After:
|
2011-03-29 08:28:20 +01:00
|
|
|
|
2011-03-28 16:07:05 +01:00
|
|
|
app/Resources/views/base.html.twig
|
2011-03-28 18:25:40 +01:00
|
|
|
app/Resources/AcmeDemo/views/base.html.twig
|
2011-03-28 16:07:05 +01:00
|
|
|
|
2011-03-28 17:12:15 +01:00
|
|
|
* Bundle logical names lose their `Bundle` suffix:
|
|
|
|
|
|
|
|
*Controllers*: `BlogBundle:Post:show` -> `Blog:Post:show`
|
2011-03-28 17:44:40 +01:00
|
|
|
|
2011-03-28 17:12:15 +01:00
|
|
|
*Templates*: `BlogBundle:Post:show.html.twig` -> `Blog:Post:show.html.twig`
|
2011-03-28 17:44:40 +01:00
|
|
|
|
2011-03-28 17:12:15 +01:00
|
|
|
*Resources*: `@BlogBundle/Resources/config/blog.xml` -> `@Blog/Resources/config/blog.xml`
|
2011-03-28 17:44:40 +01:00
|
|
|
|
2011-03-28 17:12:15 +01:00
|
|
|
*Doctrine*: `$em->find('BlogBundle:Post', $id)` -> `$em->find('Blog:Post', $id)`
|
2011-04-03 11:04:31 +01:00
|
|
|
|
|
|
|
* Assetic filters must be now explicitly loaded:
|
|
|
|
|
|
|
|
assetic:
|
|
|
|
filters:
|
|
|
|
cssrewrite: ~
|
|
|
|
yui_css:
|
|
|
|
jar: "/path/to/yuicompressor.jar"
|
|
|
|
my_filter:
|
|
|
|
resource: "%kernel.root_dir%/config/my_filter.xml"
|
|
|
|
foo: bar
|