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-06-06 17:07:33 +01:00
|
|
|
beta4 to beta5
|
|
|
|
--------------
|
|
|
|
|
2011-06-14 11:19:35 +01:00
|
|
|
* `Yaml::load()` has been renamed to `Yaml::parse()`
|
|
|
|
|
2011-06-11 06:50:14 +01:00
|
|
|
* The `extensions` setting for Twig has been removed. There is now only one
|
|
|
|
way to register Twig extensions, via the `twig.extension` tag.
|
|
|
|
|
2011-06-10 18:42:03 +01:00
|
|
|
* The stack of Monolog handlers now bubbles the records by default. To stop
|
|
|
|
the propagation you need to configure the bubbling explicitly.
|
|
|
|
|
2011-06-10 00:13:38 +01:00
|
|
|
* Expanded the SerializerInterface, while reducing the number of public
|
2011-06-10 14:04:57 +01:00
|
|
|
methods in the Serializer class itself breaking BC and adding component
|
|
|
|
specific Exception classes.
|
2011-06-10 00:13:38 +01:00
|
|
|
|
2011-06-13 07:14:41 +01:00
|
|
|
* The FileType Form class has been heavily changed:
|
|
|
|
|
|
|
|
* The temporary storage has been removed.
|
|
|
|
|
|
|
|
* The file type `type` option has also been removed (the new behavior is
|
|
|
|
the same as when the `type` was set to `file` before).
|
|
|
|
|
|
|
|
* The file input is now rendered as any other input field.
|
2011-06-09 07:02:33 +01:00
|
|
|
|
2011-06-09 11:42:42 +01:00
|
|
|
* The `Symfony\Component\HttpFoundation\File\File::getExtension()` and
|
|
|
|
`guessExtension()` methods do not return the extension with a `.` anymore.
|
|
|
|
|
2011-06-08 07:07:12 +01:00
|
|
|
* The `em` option of the Doctrine `EntityType` class now takes the entity
|
|
|
|
manager name instead of the EntityManager instance. If you don't pass this
|
|
|
|
option, the default Entity Manager will be used as before.
|
|
|
|
|
2011-06-07 16:51:43 +01:00
|
|
|
* In the Console component: `Command::getFullname()` and
|
|
|
|
`Command::getNamespace()` have been removed (`Command::getName()` behavior
|
|
|
|
is now the same as the old `Command::getFullname()`).
|
|
|
|
|
2011-06-07 15:32:42 +01:00
|
|
|
* Default Twig form templates have been moved to the Twig bridge. Here is how
|
|
|
|
you can reference them now from a template or in a configuration setting:
|
|
|
|
|
|
|
|
Before:
|
|
|
|
|
|
|
|
`TwigBundle:Form:div_layout.html.twig`
|
|
|
|
|
|
|
|
After:
|
|
|
|
|
|
|
|
`div_layout.html.twig`
|
|
|
|
|
2011-06-07 10:48:08 +01:00
|
|
|
* All settings regarding the cache warmers have been removed.
|
|
|
|
|
2011-06-06 17:07:33 +01:00
|
|
|
* `Response::isRedirected()` has been merged with `Response::isRedirect()`
|
|
|
|
|
2011-05-28 09:56:44 +01:00
|
|
|
beta3 to beta4
|
|
|
|
--------------
|
|
|
|
|
2011-06-01 09:55:01 +01:00
|
|
|
* `Client::getProfiler` has been removed in favor of `Client::getProfile`,
|
|
|
|
which returns an instance of `Profile`.
|
|
|
|
|
2011-05-31 08:28:29 +01:00
|
|
|
* Some `UniversalClassLoader` methods have been renamed:
|
|
|
|
|
|
|
|
* `registerPrefixFallback` to `registerPrefixFallbacks`
|
|
|
|
* `registerNamespaceFallback` to `registerNamespaceFallbacks`
|
|
|
|
|
2011-05-30 08:58:14 +01:00
|
|
|
* The event system has been made more flexible. A listener can now be any
|
|
|
|
valid PHP callable.
|
|
|
|
|
|
|
|
* `EventDispatcher::addListener($eventName, $listener, $priority = 0)`:
|
2011-06-02 11:51:23 +01:00
|
|
|
* `$eventName` is the event name (cannot be an array anymore),
|
|
|
|
* `$listener` is a PHP callable.
|
2011-05-30 08:58:14 +01:00
|
|
|
|
|
|
|
* The events classes and constants have been renamed:
|
|
|
|
|
2011-06-02 11:51:23 +01:00
|
|
|
* Old class name `Symfony\Component\Form\Events` and constants:
|
2011-05-30 08:58:14 +01:00
|
|
|
|
2011-06-02 11:51:23 +01:00
|
|
|
Events::preBind = 'preBind'
|
|
|
|
Events::postBind = 'postBind'
|
|
|
|
Events::preSetData = 'preSetData'
|
|
|
|
Events::postSetData = 'postSetData'
|
|
|
|
Events::onBindClientData = 'onBindClientData'
|
|
|
|
Events::onBindNormData = 'onBindNormData'
|
|
|
|
Events::onSetData = 'onSetData'
|
2011-05-30 08:58:14 +01:00
|
|
|
|
2011-06-02 11:51:23 +01:00
|
|
|
* New class name `Symfony\Component\Form\FormEvents` and constants:
|
2011-05-30 08:58:14 +01:00
|
|
|
|
2011-06-02 11:51:23 +01:00
|
|
|
FormEvents::PRE_BIND = 'form.pre_bind'
|
|
|
|
FormEvents::POST_BIND = 'form.post_bind'
|
|
|
|
FormEvents::PRE_SET_DATA = 'form.pre_set_data'
|
|
|
|
FormEvents::POST_SET_DATA = 'form.post_set_data'
|
|
|
|
FormEvents::BIND_CLIENT_DATA = 'form.bind_client_data'
|
|
|
|
FormEvents::BIND_NORM_DATA = 'form.bind_norm_data'
|
|
|
|
FormEvents::SET_DATA = 'form.set_data'
|
2011-05-30 08:58:14 +01:00
|
|
|
|
2011-06-02 11:51:23 +01:00
|
|
|
* Old class name `Symfony\Component\HttpKernel\Events` and constants:
|
2011-05-30 08:58:14 +01:00
|
|
|
|
2011-06-02 11:51:23 +01:00
|
|
|
Events::onCoreRequest = 'onCoreRequest'
|
|
|
|
Events::onCoreException = 'onCoreException'
|
|
|
|
Events::onCoreView = 'onCoreView'
|
|
|
|
Events::onCoreController = 'onCoreController'
|
|
|
|
Events::onCoreResponse = 'onCoreResponse'
|
2011-05-30 08:58:14 +01:00
|
|
|
|
2011-06-02 11:51:23 +01:00
|
|
|
* New class name `Symfony\Component\HttpKernel\CoreEvents` and constants:
|
2011-05-30 08:58:14 +01:00
|
|
|
|
2011-06-02 11:51:23 +01:00
|
|
|
CoreEvents::REQUEST = 'core.request'
|
|
|
|
CoreEvents::EXCEPTION = 'core.exception'
|
|
|
|
CoreEvents::VIEW = 'core.view'
|
|
|
|
CoreEvents::CONTROLLER = 'core.controller'
|
|
|
|
CoreEvents::RESPONSE = 'core.response'
|
2011-05-30 08:58:14 +01:00
|
|
|
|
2011-06-02 11:51:23 +01:00
|
|
|
* Old class name `Symfony\Component\Security\Http\Events` and constants:
|
|
|
|
|
|
|
|
Events::onSecurityInteractiveLogin = 'onSecurityInteractiveLogin'
|
|
|
|
Events::onSecuritySwitchUser = 'onSecuritySwitchUser'
|
|
|
|
|
|
|
|
* New class name `Symfony\Component\Security\Http\SecurityEvents` and constants:
|
|
|
|
|
|
|
|
SecurityEvents::INTERACTIVE_LOGIN = 'security.interactive_login'
|
|
|
|
SecurityEvents::SWITCH_USER = 'security.switch_user'
|
2011-05-30 08:58:14 +01:00
|
|
|
|
|
|
|
* `addListenerService` now only takes a single event name as its first
|
2011-06-02 11:51:23 +01:00
|
|
|
argument,
|
2011-05-30 08:58:14 +01:00
|
|
|
|
|
|
|
* Tags in configuration must now set the method to call:
|
|
|
|
|
2011-06-02 11:51:23 +01:00
|
|
|
* Before:
|
|
|
|
|
|
|
|
<tag name="kernel.listener" event="onCoreRequest" />
|
|
|
|
|
|
|
|
* After:
|
|
|
|
|
|
|
|
<tag name="kernel.listener" event="core.request" method="onCoreRequest" />
|
2011-05-30 08:58:14 +01:00
|
|
|
|
|
|
|
* Subscribers must now always return a hash:
|
|
|
|
|
2011-06-02 11:51:23 +01:00
|
|
|
* Before:
|
|
|
|
|
|
|
|
public static function getSubscribedEvents()
|
|
|
|
{
|
|
|
|
return Events::onBindNormData;
|
|
|
|
}
|
|
|
|
|
|
|
|
* After:
|
2011-05-30 08:58:14 +01:00
|
|
|
|
2011-06-02 11:51:23 +01:00
|
|
|
public static function getSubscribedEvents()
|
|
|
|
{
|
|
|
|
return array(FormEvents::BIND_NORM_DATA => 'onBindNormData');
|
|
|
|
}
|
|
|
|
|
|
|
|
* Form `DateType` parameter `single-text` changed to `single_text`
|
|
|
|
* Form field label helpers now accepts setting attributes, i.e.:
|
|
|
|
|
|
|
|
```html+jinja
|
|
|
|
{{ form_label(form.name, 'Custom label', { 'attr': {'class': 'name_field'} }) }}
|
|
|
|
```
|
2011-05-28 09:56:44 +01:00
|
|
|
|
2011-06-06 17:04:44 +01:00
|
|
|
* In order to use Swiftmailer, you should now register its "init.php" file via
|
|
|
|
the autoloader ("app/autoloader.php") and remove the `Swift_` prefix from
|
|
|
|
the autoloader. For an example on how this should be done, see the Standard
|
|
|
|
Distribution
|
|
|
|
[autoload.php](https://github.com/symfony/symfony-standard/blob/v2.0.0BETA4/app/autoload.php#L29).
|
|
|
|
|
2011-05-24 12:29:44 +01:00
|
|
|
beta2 to beta3
|
|
|
|
--------------
|
|
|
|
|
2011-06-02 11:51:23 +01:00
|
|
|
* The settings under `framework.annotations` have changed slightly:
|
2011-05-24 12:29:44 +01:00
|
|
|
|
2011-06-02 11:51:23 +01:00
|
|
|
Before:
|
2011-06-10 18:42:03 +01:00
|
|
|
|
2011-06-02 11:51:23 +01:00
|
|
|
framework:
|
|
|
|
annotations:
|
|
|
|
cache: file
|
|
|
|
file_cache:
|
|
|
|
debug: true
|
|
|
|
dir: /foo
|
2011-06-10 18:42:03 +01:00
|
|
|
|
2011-06-02 11:51:23 +01:00
|
|
|
After:
|
2011-06-10 18:42:03 +01:00
|
|
|
|
2011-06-02 11:51:23 +01:00
|
|
|
framework:
|
|
|
|
annotations:
|
|
|
|
cache: file
|
|
|
|
debug: true
|
|
|
|
file_cache_dir: /foo
|
2011-05-24 12:29:44 +01:00
|
|
|
|
2011-04-27 22:01:04 +01:00
|
|
|
beta1 to beta2
|
|
|
|
--------------
|
|
|
|
|
2011-05-23 07:04:20 +01:00
|
|
|
* The annotation parsing process has been changed (it now uses Doctrine Common
|
|
|
|
3.0). All annotations which are used in a class must now be imported (just
|
|
|
|
like you import PHP namespaces with the "use" statement):
|
2011-04-28 22:09:08 +01:00
|
|
|
|
|
|
|
Before:
|
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
``` php
|
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @orm:Entity
|
|
|
|
*/
|
|
|
|
class AcmeUser
|
|
|
|
{
|
2011-04-28 22:09:08 +01:00
|
|
|
/**
|
2011-05-23 23:54:31 +01:00
|
|
|
* @orm:Id
|
|
|
|
* @orm:GeneratedValue(strategy = "AUTO")
|
|
|
|
* @orm:Column(type="integer")
|
|
|
|
* @var integer
|
2011-04-28 22:09:08 +01:00
|
|
|
*/
|
2011-05-23 23:54:31 +01:00
|
|
|
private $id;
|
2011-04-28 22:09:08 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
/**
|
|
|
|
* @orm:Column(type="string", nullable=false)
|
|
|
|
* @assert:NotBlank
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $name;
|
|
|
|
}
|
|
|
|
```
|
2011-04-28 22:09:08 +01:00
|
|
|
After:
|
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
``` php
|
|
|
|
<?php
|
|
|
|
|
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
2011-05-01 13:30:44 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
/**
|
|
|
|
* @ORM\Entity
|
|
|
|
*/
|
|
|
|
class AcmeUser
|
|
|
|
{
|
2011-04-28 22:09:08 +01:00
|
|
|
/**
|
2011-05-23 23:54:31 +01:00
|
|
|
* @ORM\Id
|
|
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
|
|
* @ORM\Column(type="integer")
|
|
|
|
*
|
|
|
|
* @var integer
|
2011-04-28 22:09:08 +01:00
|
|
|
*/
|
2011-05-23 23:54:31 +01:00
|
|
|
private $id;
|
2011-04-28 22:09:08 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
/**
|
|
|
|
* @ORM\Column(type="string", nullable=false)
|
|
|
|
* @Assert\NotBlank
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
private $name;
|
|
|
|
}
|
|
|
|
```
|
2011-04-28 22:09:08 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
* The `Set` constraint has been removed as it is not required anymore.
|
|
|
|
|
|
|
|
Before:
|
|
|
|
|
|
|
|
``` php
|
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @orm:Entity
|
|
|
|
*/
|
|
|
|
class AcmeEntity
|
|
|
|
{
|
2011-04-28 22:09:08 +01:00
|
|
|
/**
|
|
|
|
* @assert:Set({@assert:Callback(...), @assert:Callback(...)})
|
|
|
|
*/
|
|
|
|
private $foo;
|
2011-05-23 23:54:31 +01:00
|
|
|
}
|
|
|
|
```
|
|
|
|
After:
|
2011-04-28 22:09:08 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
``` php
|
|
|
|
<?php
|
2011-04-28 22:09:08 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
use Symfony\Component\Validator\Constraints\Callback;
|
2011-05-01 13:30:44 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
/**
|
|
|
|
* @ORM\Entity
|
|
|
|
*/
|
|
|
|
class AcmeEntity
|
|
|
|
{
|
2011-04-28 22:09:08 +01:00
|
|
|
/**
|
|
|
|
* @Callback(...)
|
|
|
|
* @Callback(...)
|
|
|
|
*/
|
2011-05-23 23:54:31 +01:00
|
|
|
private $foo;
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2011-06-10 18:42:03 +01:00
|
|
|
* The config under `framework.validation.annotations` has been removed and was
|
2011-05-23 23:54:31 +01:00
|
|
|
replaced with a boolean flag `framework.validation.enable_annotations` which
|
|
|
|
defaults to false.
|
2011-04-28 22:09:08 +01:00
|
|
|
|
2011-05-18 12:14:51 +01:00
|
|
|
* Forms must now be explicitly enabled (automatically done in Symfony SE):
|
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
framework:
|
|
|
|
form: ~
|
|
|
|
|
|
|
|
Which is equivalent to:
|
2011-05-18 12:14:51 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
framework:
|
|
|
|
form:
|
|
|
|
enabled: true
|
2011-05-18 12:14:51 +01:00
|
|
|
|
2011-05-17 09:11:27 +01:00
|
|
|
* The Routing Exceptions have been moved:
|
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
Before:
|
2011-05-17 09:11:27 +01:00
|
|
|
|
2011-05-18 12:14:51 +01:00
|
|
|
Symfony\Component\Routing\Matcher\Exception\Exception
|
|
|
|
Symfony\Component\Routing\Matcher\Exception\NotFoundException
|
|
|
|
Symfony\Component\Routing\Matcher\Exception\MethodNotAllowedException
|
2011-05-17 09:11:27 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
After:
|
2011-05-17 09:11:27 +01:00
|
|
|
|
2011-05-18 12:14:51 +01:00
|
|
|
Symfony\Component\Routing\Exception\Exception
|
|
|
|
Symfony\Component\Routing\Exception\NotFoundException
|
|
|
|
Symfony\Component\Routing\Exception\MethodNotAllowedException
|
2011-05-17 09:11:27 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
* The form component's `csrf_page_id` option has been renamed to
|
|
|
|
`intention`.
|
2011-05-16 22:17:39 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
* The `error_handler` setting has been removed. The `ErrorHandler` class
|
|
|
|
is now managed directly by Symfony SE in `AppKernel`.
|
2011-05-05 07:46:04 +01:00
|
|
|
|
2011-05-03 11:25:58 +01:00
|
|
|
* The Doctrine metadata files has moved from
|
2011-05-23 23:54:31 +01:00
|
|
|
`Resources/config/doctrine/metadata/orm/` to `Resources/config/doctrine`,
|
|
|
|
the extension from `.dcm.yml` to `.orm.yml`, and the file name has been
|
2011-05-14 16:30:16 +01:00
|
|
|
changed to the short class name.
|
2011-05-03 11:25:58 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
Before:
|
2011-05-03 11:25:58 +01:00
|
|
|
|
|
|
|
Resources/config/doctrine/metadata/orm/Bundle.Entity.dcm.xml
|
|
|
|
Resources/config/doctrine/metadata/orm/Bundle.Entity.dcm.yml
|
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
After:
|
2011-05-03 11:25:58 +01:00
|
|
|
|
2011-05-14 16:30:16 +01:00
|
|
|
Resources/config/doctrine/Entity.orm.xml
|
|
|
|
Resources/config/doctrine/Entity.orm.yml
|
2011-05-03 11:25:58 +01:00
|
|
|
|
2011-05-02 14:32:54 +01:00
|
|
|
* With the introduction of a new Doctrine Registry class, the following
|
|
|
|
parameters have been removed (replaced by methods on the `doctrine`
|
|
|
|
service):
|
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
* `doctrine.orm.entity_managers`
|
|
|
|
* `doctrine.orm.default_entity_manager`
|
|
|
|
* `doctrine.dbal.default_connection`
|
2011-05-02 14:32:54 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
Before:
|
2011-05-02 14:32:54 +01:00
|
|
|
|
|
|
|
$container->getParameter('doctrine.orm.entity_managers')
|
|
|
|
$container->getParameter('doctrine.orm.default_entity_manager')
|
|
|
|
$container->getParameter('doctrine.orm.default_connection')
|
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
After:
|
2011-05-02 14:32:54 +01:00
|
|
|
|
|
|
|
$container->get('doctrine')->getEntityManagerNames()
|
|
|
|
$container->get('doctrine')->getDefaultEntityManagerName()
|
|
|
|
$container->get('doctrine')->getDefaultConnectionName()
|
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
But you don't really need to use these methods anymore, as to get an entity
|
|
|
|
manager, you can now use the registry directly:
|
2011-05-02 14:32:54 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
Before:
|
2011-05-02 14:32:54 +01:00
|
|
|
|
|
|
|
$em = $this->get('doctrine.orm.entity_manager');
|
|
|
|
$em = $this->get('doctrine.orm.foobar_entity_manager');
|
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
After:
|
2011-05-02 14:32:54 +01:00
|
|
|
|
|
|
|
$em = $this->get('doctrine')->getEntityManager();
|
|
|
|
$em = $this->get('doctrine')->getEntityManager('foobar');
|
|
|
|
|
2011-05-01 21:57:23 +01:00
|
|
|
* The `doctrine:generate:entities` arguments and options changed. Run
|
|
|
|
`./app/console doctrine:generate:entities --help` for more information about
|
|
|
|
the new syntax.
|
|
|
|
|
|
|
|
* The `doctrine:generate:repositories` command has been removed. The
|
|
|
|
functionality has been moved to the `doctrine:generate:entities`.
|
|
|
|
|
2011-04-27 22:03:29 +01:00
|
|
|
* Doctrine event subscribers now use a unique "doctrine.event_subscriber" tag.
|
|
|
|
Doctrine event listeners also use a unique "doctrine.event_listener" tag. To
|
|
|
|
specify a connection, use the optional "connection" attribute.
|
|
|
|
|
|
|
|
Before:
|
|
|
|
|
|
|
|
listener:
|
|
|
|
class: MyEventListener
|
|
|
|
tags:
|
|
|
|
- { name: doctrine.common.event_listener, event: name }
|
|
|
|
- { name: doctrine.dbal.default_event_listener, event: name }
|
|
|
|
subscriber:
|
|
|
|
class: MyEventSubscriber
|
|
|
|
tags:
|
|
|
|
- { name: doctrine.common.event_subscriber }
|
|
|
|
- { name: doctrine.dbal.default_event_subscriber }
|
|
|
|
|
|
|
|
After:
|
|
|
|
|
|
|
|
listener:
|
|
|
|
class: MyEventListener
|
|
|
|
tags:
|
|
|
|
- { name: doctrine.event_listener, event: name } # register for all connections
|
|
|
|
- { name: doctrine.event_listener, event: name, connection: default } # only for the default connection
|
|
|
|
subscriber:
|
|
|
|
class: MyEventSubscriber
|
|
|
|
tags:
|
|
|
|
- { name: doctrine.event_subscriber } # register for all connections
|
|
|
|
- { name: doctrine.event_subscriber, connection: default } # only for the default connection
|
|
|
|
|
2011-04-30 06:25:08 +01:00
|
|
|
* Application translations are now stored in the `Resources` directory:
|
2011-04-29 16:48:38 +01:00
|
|
|
|
|
|
|
Before:
|
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
app/translations/catalogue.fr.xml
|
2011-04-29 16:48:38 +01:00
|
|
|
|
|
|
|
After:
|
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
app/Resources/translations/catalogue.fr.xml
|
2011-04-29 16:48:38 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
* The option `modifiable` of the `collection` form type was split into two
|
|
|
|
options `allow_add` and `allow_delete`.
|
2011-05-04 16:29:59 +01:00
|
|
|
|
|
|
|
Before:
|
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
$builder->add('tags', 'collection', array(
|
|
|
|
'type' => 'text',
|
|
|
|
'modifiable' => true,
|
|
|
|
));
|
2011-05-04 16:29:59 +01:00
|
|
|
|
|
|
|
After:
|
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
$builder->add('tags', 'collection', array(
|
|
|
|
'type' => 'text',
|
|
|
|
'allow_add' => true,
|
|
|
|
'allow_delete' => true,
|
|
|
|
));
|
2011-06-10 18:42:03 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
* `Request::hasSession()` has been renamed to `Request::hasPreviousSession()`. The
|
|
|
|
method `hasSession()` still exists, but only checks if the request contains a
|
2011-05-05 07:35:02 +01:00
|
|
|
session object, not if the session was started in a previous request.
|
2011-05-04 16:29:59 +01:00
|
|
|
|
2011-05-06 18:36:56 +01:00
|
|
|
* Serializer: The NormalizerInterface's `supports()` method has been split in
|
2011-05-23 23:54:31 +01:00
|
|
|
two methods: `supportsNormalization()` and `supportsDenormalization()`.
|
2011-05-06 18:36:56 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
* `ParameterBag::getDeep()` has been removed, and is replaced with a boolean flag
|
|
|
|
on the `ParameterBag::get()` method.
|
2011-05-10 10:27:18 +01:00
|
|
|
|
2011-05-08 17:23:26 +01:00
|
|
|
* Serializer: `AbstractEncoder` & `AbstractNormalizer` were renamed to
|
|
|
|
`SerializerAwareEncoder` & `SerializerAwareNormalizer`.
|
|
|
|
|
2011-05-08 17:32:22 +01:00
|
|
|
* Serializer: The `$properties` argument has been dropped from all interfaces.
|
2011-05-11 00:32:39 +01:00
|
|
|
|
2011-06-10 18:42:03 +01:00
|
|
|
* Form: Renamed option value `text` of `widget` option of the `date` type was
|
2011-05-23 23:54:31 +01:00
|
|
|
renamed to `single-text`. `text` indicates to use separate text boxes now
|
|
|
|
(like for the `time` type).
|
2011-06-10 18:42:03 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
* Form: Renamed view variable `name` to `full_name`. The variable `name` now
|
|
|
|
contains the local, short name (equivalent to `$form->getName()`).
|
2011-05-13 18:17:28 +01:00
|
|
|
|
2011-04-21 08:04:16 +01:00
|
|
|
PR12 to beta1
|
|
|
|
-------------
|
|
|
|
|
2011-04-28 09:49:59 +01:00
|
|
|
* The CSRF secret configuration has been moved to a mandatory global `secret`
|
|
|
|
setting (as the secret is now used for everything and not just CSRF):
|
|
|
|
|
|
|
|
Before:
|
|
|
|
|
|
|
|
framework:
|
|
|
|
csrf_protection:
|
|
|
|
secret: S3cr3t
|
|
|
|
|
|
|
|
After:
|
|
|
|
|
|
|
|
framework:
|
|
|
|
secret: S3cr3t
|
|
|
|
|
2011-04-27 15:08:50 +01:00
|
|
|
* The `File::getWebPath()` and `File::rename()` methods have been removed, as
|
|
|
|
well as the `framework.document_root` configuration setting.
|
2011-04-27 05:44:52 +01:00
|
|
|
|
2011-05-08 21:02:13 +01:00
|
|
|
* The `File::getDefaultExtension()` method has been renamed to `File::guessExtension()`.
|
2011-05-08 10:15:41 +01:00
|
|
|
The renamed method now returns null if it cannot guess the extension.
|
|
|
|
|
2011-04-22 12:45:23 +01:00
|
|
|
* The `session` configuration has been refactored:
|
|
|
|
|
|
|
|
* The `class` option has been removed (use the `session.class` parameter
|
|
|
|
instead);
|
|
|
|
|
|
|
|
* The PDO session storage configuration has been removed (a cookbook recipe
|
|
|
|
is in the work);
|
|
|
|
|
|
|
|
* The `storage_id` option now takes a service id instead of just part of it.
|
|
|
|
|
|
|
|
* The `DoctrineMigrationsBundle` and `DoctrineFixturesBundle` bundles have
|
|
|
|
been moved to their own repositories.
|
|
|
|
|
2011-04-22 09:14:23 +01:00
|
|
|
* The form framework has been refactored extensively (more information in the
|
|
|
|
documentation).
|
|
|
|
|
2011-04-21 08:04:16 +01:00
|
|
|
* The `trans` tag does not accept a message as an argument anymore:
|
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
{% trans "foo" %}
|
|
|
|
{% trans foo %}
|
2011-04-21 08:04:16 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
Use the long version the tags or the filter instead:
|
2011-04-21 08:04:16 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
{% trans %}foo{% endtrans %}
|
|
|
|
{{ foo|trans }}
|
2011-04-21 08:04:16 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
This has been done to clarify the usage of the tag and filter and also to
|
|
|
|
make it clearer when the automatic output escaping rules are applied (see
|
|
|
|
the doc for more information).
|
2011-04-20 12:48:32 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
* Some methods in the DependencyInjection component's `ContainerBuilder` and
|
|
|
|
`Definition` classes have been renamed to be more specific and consistent:
|
2011-04-20 12:48:32 +01:00
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
Before:
|
2011-04-20 12:48:32 +01:00
|
|
|
|
|
|
|
$container->remove('my_definition');
|
|
|
|
$definition->setArgument(0, 'foo');
|
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
After:
|
2011-04-20 12:48:32 +01:00
|
|
|
|
|
|
|
$container->removeDefinition('my_definition');
|
|
|
|
$definition->replaceArgument(0, 'foo');
|
2011-04-22 12:45:23 +01:00
|
|
|
|
|
|
|
* In the rememberme configuration, the `token_provider key` now expects a real
|
2011-04-20 21:20:55 +01:00
|
|
|
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-05-23 23:54:31 +01:00
|
|
|
* `HttpFoundation\Cookie::getExpire()` was renamed to `getExpiresTime()`
|
2011-04-19 13:05:08 +01:00
|
|
|
|
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
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
Before:
|
2011-04-13 13:13:04 +01:00
|
|
|
|
|
|
|
<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
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
After:
|
2011-04-13 13:13:04 +01:00
|
|
|
|
|
|
|
<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-05-06 18:36:56 +01:00
|
|
|
* Fixes a critical security issue which allowed all users to switch to
|
2011-04-19 11:12:29 +01:00
|
|
|
arbitrary accounts when the SwitchUserListener was activated. Configurations
|
|
|
|
which do not use the SwitchUserListener are not affected.
|
|
|
|
|
2011-05-06 18:36:56 +01:00
|
|
|
* The Dependency Injection Container now strongly validates the references of
|
2011-04-14 23:11:50 +01:00
|
|
|
all your services at the end of its compilation process. If you have invalid
|
|
|
|
references this will result in a compile-time exception instead of a run-time
|
|
|
|
exception (the previous behavior).
|
|
|
|
|
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.
|
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
* 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:
|
|
|
|
|
2011-05-23 23:54:31 +01:00
|
|
|
assetic:
|
|
|
|
filters:
|
|
|
|
cssrewrite: ~
|
|
|
|
yui_css:
|
|
|
|
jar: "/path/to/yuicompressor.jar"
|
|
|
|
my_filter:
|
|
|
|
resource: "%kernel.root_dir%/config/my_filter.xml"
|
2011-05-28 09:56:44 +01:00
|
|
|
foo: bar
|