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.
|
|
|
|
|
|
|
|
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:
|
|
|
|
|
|
|
|
Before: throw new NotFoundHttpException('Not Found', $message, 0, $e);
|
|
|
|
After: throw new NotFoundHttpException($message, $e);
|
|
|
|
|
|
|
|
* The RequestMatcher class does not add `^` and `$` anymore to regexp.
|
|
|
|
|
|
|
|
You need to update your security configuration accordingly for instance:
|
|
|
|
|
|
|
|
Before:
|
|
|
|
|
|
|
|
profiler:
|
|
|
|
pattern: /_profiler/.*
|
|
|
|
|
|
|
|
After:
|
|
|
|
|
|
|
|
profiler:
|
|
|
|
pattern: ^/_profiler
|
|
|
|
|
|
|
|
* Global templates under `app/` moved to a new location (old directory did not
|
|
|
|
work anyway):
|
|
|
|
|
|
|
|
Before:
|
|
|
|
app/views/base.html.twig
|
|
|
|
app/views/AcmeDemoBundle/base.html.twig
|
|
|
|
|
|
|
|
After:
|
|
|
|
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
|
|
|
|
|
|
|
* Namespace for validators has changed from `validation` to `assert`:
|
|
|
|
|
|
|
|
Before: @validation:NotNull
|
|
|
|
After: @assert:NotNull
|
|
|
|
|
|
|
|
Moreover, the `Assert` prefix used for some constraints has been removed
|
|
|
|
(`AssertTrue` to `True`).
|
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)`
|