From c01bc536ef3c35be9f0a28c5d1d4573c695ecaa6 Mon Sep 17 00:00:00 2001 From: Javier Lopez Date: Thu, 18 Oct 2012 21:23:09 +0200 Subject: [PATCH 1/6] Update reference/configuration/framework.rst This PR is related to this one https://github.com/symfony/symfony/pull/5347. --- reference/configuration/framework.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index ce6216bb916..7ad7bd53968 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -26,6 +26,8 @@ Configuration * field_name * `session`_ * `lifetime`_ +* `serializer`_ + * enabled * `templating`_ * `assets_base_urls`_ * `assets_version`_ @@ -112,6 +114,23 @@ lifetime This determines the lifetime of the session - in seconds. By default it will use ``0``, which means the cookie is valid for the length of the browser session. +serializer +~~~~~~~~~~ + +enabled +....... + +**type**: ``boolean`` **default**: ``false`` + +Whether to enable or not the serializer service in the service container. If enabled, +the serializer will be loaded along with two encoders (:class:`Symfony\\Component\\Serializer\\Encoder\\JsonEncoder` +and :class:`Symfony\\Component\\Serializer\\Encoder\\XmlEncoder) +and one normalizer (:class:`Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer`). + +You can add more normalizers and/or encoders by tagging them as `serializer.encoder` and +`serializer.normalizer`. It's also possible to set the priority of the tag in order to decide the +matching order. + templating ~~~~~~~~~~ @@ -319,6 +338,10 @@ Full Default Configuration # DEPRECATED! Please use: cookie_httponly httponly: ~ + # serializer configuration + serializer: + enabled: false + # templating configuration templating: assets_version: ~ From 460406edf272e61a1826279d23d391b64d6f1355 Mon Sep 17 00:00:00 2001 From: Javier Lopez Date: Sun, 21 Oct 2012 19:34:05 +0200 Subject: [PATCH 2/6] Update reference/dic_tags.rst Adding tags to the tag list reference --- reference/dic_tags.rst | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/reference/dic_tags.rst b/reference/dic_tags.rst index fa7ea84e043..27d681653f1 100644 --- a/reference/dic_tags.rst +++ b/reference/dic_tags.rst @@ -42,6 +42,10 @@ the AsseticBundle has several tags that aren't listed here. +-----------------------------------+---------------------------------------------------------------------------+ | `security.listener.factory`_ | Necessary when creating a custom authentication system | +-----------------------------------+---------------------------------------------------------------------------+ +| `serializer.encoder`_ | Register a new encoder in the Serializer service | ++-----------------------------------+---------------------------------------------------------------------------+ +| `serializer.normalizer`_ | Register a new normalizer in the Serializer service | ++-----------------------------------+---------------------------------------------------------------------------+ | `swiftmailer.plugin`_ | Register a custom SwiftMailer Plugin | +-----------------------------------+---------------------------------------------------------------------------+ | `templating.helper`_ | Make your service available in PHP templates | @@ -558,6 +562,24 @@ is used behind the scenes to determine if the user should have access. The For more information, read the cookbook article: :doc:`/cookbook/security/voters`. +serializer.encoder +------------------ + +**Purpose**: Register a new encoder in the Serializer service + +You have to enable the Serializer service in order to use this tag. The class to +be tagged should extend the :class:`Symfony\\Component\\Serializer\\Encoder\\EncoderInterface` +and :class:`Symfony\\Component\\Serializer\\Encoder\\DecoderInterface` + +serializer.normalizer +--------------------- + +**Purpose**: Register a new normalizer in the Serializer service + +You have to enable the Serializer service in order to use this tag. The class to +be tagged should extend the :class:`Symfony\\Component\\Serializer\\Normalizer\\NormalizerInterface` +and :class:`Symfony\\Component\\Serializer\\Normalizer\\DenormalizerInterface` + swiftmailer.plugin ------------------ From f723940a8309221e016b852699ec6d2ff423db5d Mon Sep 17 00:00:00 2001 From: Javier Lopez Date: Sun, 21 Oct 2012 19:38:12 +0200 Subject: [PATCH 3/6] Update reference/configuration/framework.rst Changing backticks --- reference/configuration/framework.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 7ad7bd53968..e5c122aeecc 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -127,8 +127,8 @@ the serializer will be loaded along with two encoders (:class:`Symfony\\Componen and :class:`Symfony\\Component\\Serializer\\Encoder\\XmlEncoder) and one normalizer (:class:`Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer`). -You can add more normalizers and/or encoders by tagging them as `serializer.encoder` and -`serializer.normalizer`. It's also possible to set the priority of the tag in order to decide the +You can add more normalizers and/or encoders by tagging them as ``serializer.encoder`` and +``serializer.normalizer``. It's also possible to set the priority of the tag in order to decide the matching order. templating From 70ca20c337f1b90f09415312fef03b7c126ee435 Mon Sep 17 00:00:00 2001 From: Javier Lopez Date: Mon, 29 Oct 2012 20:05:33 +0000 Subject: [PATCH 4/6] Update reference/configuration/framework.rst The GetSetMethodNormalizer is not loaded by default --- reference/configuration/framework.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index e5c122aeecc..aede5c5867a 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -124,8 +124,9 @@ enabled Whether to enable or not the serializer service in the service container. If enabled, the serializer will be loaded along with two encoders (:class:`Symfony\\Component\\Serializer\\Encoder\\JsonEncoder` -and :class:`Symfony\\Component\\Serializer\\Encoder\\XmlEncoder) -and one normalizer (:class:`Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer`). +and :class:`Symfony\\Component\\Serializer\\Encoder\\XmlEncoder`) +but none normalizer. The :class:`Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer` is broken by design +so you are required to load it under your responsability. You can do creating a new service and tagging it appropiately. You can add more normalizers and/or encoders by tagging them as ``serializer.encoder`` and ``serializer.normalizer``. It's also possible to set the priority of the tag in order to decide the From 700f5291e512311d10970465da4513d60ec74d9d Mon Sep 17 00:00:00 2001 From: Javier Lopez Date: Sun, 20 Jan 2013 13:25:48 +0000 Subject: [PATCH 5/6] Update reference/configuration/framework.rst --- reference/configuration/framework.rst | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index aede5c5867a..61c9ca12a1a 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -126,12 +126,22 @@ Whether to enable or not the serializer service in the service container. If ena the serializer will be loaded along with two encoders (:class:`Symfony\\Component\\Serializer\\Encoder\\JsonEncoder` and :class:`Symfony\\Component\\Serializer\\Encoder\\XmlEncoder`) but none normalizer. The :class:`Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer` is broken by design -so you are required to load it under your responsability. You can do creating a new service and tagging it appropiately. +so you are required to load it under your responsability. -You can add more normalizers and/or encoders by tagging them as ``serializer.encoder`` and +You can load more normalizers and/or encoders by tagging them as ``serializer.encoder`` and ``serializer.normalizer``. It's also possible to set the priority of the tag in order to decide the matching order. +Here an example on how to load the load +the :class:`Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer`: + + # app/config/config.yml + services: + get_set_method_normalizer: + class: Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer + tags: + - { name: serializer.normalizer } + templating ~~~~~~~~~~ From 63fae5b639a0cde4b9fe1630a2579bb6e10473c9 Mon Sep 17 00:00:00 2001 From: Javier Lopez Date: Sun, 20 Jan 2013 13:28:33 +0000 Subject: [PATCH 6/6] Update reference/configuration/framework.rst --- reference/configuration/framework.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/reference/configuration/framework.rst b/reference/configuration/framework.rst index 61c9ca12a1a..8781dff2bc9 100644 --- a/reference/configuration/framework.rst +++ b/reference/configuration/framework.rst @@ -135,6 +135,8 @@ matching order. Here an example on how to load the load the :class:`Symfony\\Component\\Serializer\\Normalizer\\GetSetMethodNormalizer`: +.. code-block:: yaml + # app/config/config.yml services: get_set_method_normalizer: