From 1c79cad5de50062f1436bb163d9743bca55d1374 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sun, 4 Jan 2015 11:38:24 +0100 Subject: [PATCH 01/16] clarify group validation --- book/validation.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book/validation.rst b/book/validation.rst index be3fb1caeec..be1032e1769 100644 --- a/book/validation.rst +++ b/book/validation.rst @@ -856,10 +856,10 @@ as the third argument to the ``validate()`` method:: // If you're using the new 2.5 validation API (you probably are!) $errors = $validator->validate($author, null, array('registration')); - // If you're using the old 2.4 validation API + // If you're using the old 2.4 validation API, pass the group names as the second argument // $errors = $validator->validate($author, array('registration')); -If no groups are specified, all constraints that belong in group ``Default`` +If no groups are specified, all constraints that belong to the group ``Default`` will be applied. Of course, you'll usually work with validation indirectly through the form From 9d8a69f3fbc179cd2965ff88cf626e29c8a52435 Mon Sep 17 00:00:00 2001 From: Alexander Schwenn Date: Thu, 8 Jan 2015 00:14:43 +0100 Subject: [PATCH 02/16] Fix heading level in form_login_setup.rst --- cookbook/security/form_login_setup.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbook/security/form_login_setup.rst b/cookbook/security/form_login_setup.rst index 8266e22726c..c33ae17dce9 100644 --- a/cookbook/security/form_login_setup.rst +++ b/cookbook/security/form_login_setup.rst @@ -318,7 +318,7 @@ see :doc:`/cookbook/security/form_login`. .. _book-security-common-pitfalls: Avoid common Pitfalls -===================== +--------------------- When setting up your login form, watch out for a few common pitfalls. @@ -471,4 +471,4 @@ any firewall. This means you can't check for security or even access the user object on these pages. See :doc:`/cookbook/controller/error_pages` for more details. -.. _`FOSUserBundle`: https://github.com/FriendsOfSymfony/FOSUserBundle \ No newline at end of file +.. _`FOSUserBundle`: https://github.com/FriendsOfSymfony/FOSUserBundle From f21024261a005b4fc92f9f36af7740a6725f2545 Mon Sep 17 00:00:00 2001 From: Alexander Schwenn Date: Thu, 8 Jan 2015 00:24:10 +0100 Subject: [PATCH 03/16] [BestPractices] add filename to codeblock --- best_practices/security.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/best_practices/security.rst b/best_practices/security.rst index f3ff7b40fe3..77f23f562e6 100644 --- a/best_practices/security.rst +++ b/best_practices/security.rst @@ -43,6 +43,7 @@ which uses a login form to load users from the database: .. code-block:: yaml + # app/config/security.yml security: encoders: AppBundle\Entity\User: bcrypt From 762d302e7efc3ddeff75c666013eaa2b3363b15e Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Thu, 8 Jan 2015 12:30:46 +0200 Subject: [PATCH 04/16] Remove horizontal scrollbar | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- .../dependency_injection/_imports-parameters-note.rst.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/dependency_injection/_imports-parameters-note.rst.inc b/components/dependency_injection/_imports-parameters-note.rst.inc index 3815b54e09b..2f35ec5bdef 100644 --- a/components/dependency_injection/_imports-parameters-note.rst.inc +++ b/components/dependency_injection/_imports-parameters-note.rst.inc @@ -18,7 +18,8 @@ + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd"> From 7ec7c7e13b9e182136d52b09730e800738b28e87 Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Thu, 8 Jan 2015 13:03:57 +0200 Subject: [PATCH 05/16] Update service_container.rst | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.3 | Fixed tickets | --- book/service_container.rst | 46 ++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 12 deletions(-) diff --git a/book/service_container.rst b/book/service_container.rst index a5253d7b3bc..fef11d05fda 100644 --- a/book/service_container.rst +++ b/book/service_container.rst @@ -121,7 +121,8 @@ be specified in YAML, XML or PHP: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd"> @@ -216,7 +217,8 @@ straightforward. Parameters make defining services more organized and flexible: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd"> sendmail @@ -358,7 +360,8 @@ directories don't exist, create them. + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd"> sendmail @@ -402,7 +405,8 @@ configuration. + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd"> @@ -481,8 +485,10 @@ invokes the service container extension inside the FrameworkBundle: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd + http://symfony.com/schema/dic/symfony + http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> @@ -605,6 +611,7 @@ the service container gives you a much more appealing option: services: my_mailer: # ... + newsletter_manager: class: Acme\HelloBundle\Newsletter\NewsletterManager arguments: ["@my_mailer"] @@ -615,12 +622,14 @@ the service container gives you a much more appealing option: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd"> + @@ -634,6 +643,7 @@ the service container gives you a much more appealing option: use Symfony\Component\DependencyInjection\Reference; $container->setDefinition('my_mailer', ...); + $container->setDefinition('newsletter_manager', new Definition( 'Acme\HelloBundle\Newsletter\NewsletterManager', array(new Reference('my_mailer')) @@ -686,6 +696,7 @@ Injecting the dependency by the setter method just needs a change of syntax: services: my_mailer: # ... + newsletter_manager: class: Acme\HelloBundle\Newsletter\NewsletterManager calls: @@ -697,12 +708,14 @@ Injecting the dependency by the setter method just needs a change of syntax: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd"> + @@ -718,6 +731,7 @@ Injecting the dependency by the setter method just needs a change of syntax: use Symfony\Component\DependencyInjection\Reference; $container->setDefinition('my_mailer', ...); + $container->setDefinition('newsletter_manager', new Definition( 'Acme\HelloBundle\Newsletter\NewsletterManager' ))->addMethodCall('setMailer', array( @@ -756,12 +770,14 @@ it exists and do nothing if it doesn't: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd"> + @@ -776,6 +792,7 @@ it exists and do nothing if it doesn't: use Symfony\Component\DependencyInjection\ContainerInterface; $container->setDefinition('my_mailer', ...); + $container->setDefinition('newsletter_manager', new Definition( 'Acme\HelloBundle\Newsletter\NewsletterManager', array( @@ -863,7 +880,8 @@ Configuring the service container is easy: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd"> @@ -912,6 +930,7 @@ to be used for a specific purpose. Take the following example: services: foo.twig.extension: class: Acme\HelloBundle\Extension\FooExtension + public: false tags: - { name: twig.extension } @@ -921,11 +940,13 @@ to be used for a specific purpose. Take the following example: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd"> + class="Acme\HelloBundle\Extension\FooExtension" + public="false"> @@ -937,6 +958,7 @@ to be used for a specific purpose. Take the following example: use Symfony\Component\DependencyInjection\Definition; $definition = new Definition('Acme\HelloBundle\Extension\FooExtension'); + $definition->setPublic(false); $definition->addTag('twig.extension'); $container->setDefinition('foo.twig.extension', $definition); From 3e98b3a40ddced69cf0f6b1ea84ace8224075a5c Mon Sep 17 00:00:00 2001 From: Tim Glabisch Date: Wed, 7 Jan 2015 02:57:45 +0100 Subject: [PATCH 06/16] Controller is a callable --- book/controller.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/controller.rst b/book/controller.rst index 942d5a5baab..c7cccc810db 100644 --- a/book/controller.rst +++ b/book/controller.rst @@ -4,7 +4,7 @@ Controller ========== -A controller is a PHP function you create that takes information from the +A controller is a PHP callable you create that takes information from the HTTP request and constructs and returns an HTTP response (as a Symfony ``Response`` object). The response could be an HTML page, an XML document, a serialized JSON array, an image, a redirect, a 404 error or anything else From 0a60deb33a94e278bf617cc5aa0432bcfc0b5def Mon Sep 17 00:00:00 2001 From: Alexander Schwenn Date: Fri, 9 Jan 2015 12:30:35 +0100 Subject: [PATCH 07/16] [Cookbook][Routing] Fixed typo --- cookbook/routing/service_container_parameters.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbook/routing/service_container_parameters.rst b/cookbook/routing/service_container_parameters.rst index a3c84db5c04..e40e57fec6c 100644 --- a/cookbook/routing/service_container_parameters.rst +++ b/cookbook/routing/service_container_parameters.rst @@ -8,9 +8,9 @@ Sometimes you may find it useful to make some parts of your routes globally configurable. For instance, if you build an internationalized site, you'll probably start with one or two locales. Surely you'll add a requirement to your routes to prevent a user from matching a locale -other than the locales your support. +other than the locales you support. -You *could* hardcode your ``_locale`` requirement in all your routes. But +You *could* hardcode your ``_locale`` requirement in all your routes, but a better solution is to use a configurable service container parameter right inside your routing configuration: From 7f8b051318edd1e74ab3fac7a16cb7ba338063fc Mon Sep 17 00:00:00 2001 From: Alexey Bogomazov Date: Sun, 11 Jan 2015 00:56:44 +0300 Subject: [PATCH 08/16] Changed email message instantiation to a more 'symfonysh' way. --- cookbook/email/email.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cookbook/email/email.rst b/cookbook/email/email.rst index 77392629a9f..1d9f42edc47 100644 --- a/cookbook/email/email.rst +++ b/cookbook/email/email.rst @@ -103,7 +103,8 @@ an email is pretty straightforward:: public function indexAction($name) { - $message = \Swift_Message::newInstance() + $mailer = $this->get('mailer'); + $message = $mailer->createMessage() ->setSubject('Hello Email') ->setFrom('send@example.com') ->setTo('recipient@example.com') @@ -114,7 +115,7 @@ an email is pretty straightforward:: ) ) ; - $this->get('mailer')->send($message); + $mailer->send($message); return $this->render(...); } From 93bc1bf8a72034a69c3ae3ffc93e5bb080d5cd58 Mon Sep 17 00:00:00 2001 From: "Andrew (Andrius) Marcinkevicius" Date: Tue, 13 Jan 2015 11:11:00 +0200 Subject: [PATCH 09/16] Update translation.rst | Q | A | ------------- | --- | Doc fix? | yes | New docs? | no | Applies to | 2.5 | Fixed tickets | --- book/translation.rst | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/book/translation.rst b/book/translation.rst index 13c99f02883..47c029da259 100644 --- a/book/translation.rst +++ b/book/translation.rst @@ -692,7 +692,7 @@ It will also detect the following translator usages in PHP templates: $view['translator']->trans("Symfony2 is great"); - $view['translator']->trans('Symfony2 is great'); + $view['translator']->transChoice('Symfony2 is great', 1); .. caution:: @@ -727,6 +727,12 @@ And suppose you've already setup some translations for the ``fr`` locale inside + + .. code-block:: yaml + + # src/Acme/AcmeDemoBundle/Resources/translations/messages.fr.yml + Symfony2 is great: J'aime Symfony2 + .. code-block:: php // src/Acme/AcmeDemoBundle/Resources/translations/messages.fr.php @@ -734,11 +740,6 @@ And suppose you've already setup some translations for the ``fr`` locale inside 'Symfony2 is great' => 'J\'aime Symfony2', ); - .. code-block:: yaml - - # src/Acme/AcmeDemoBundle/Resources/translations/messages.fr.yml - Symfony2 is great: J'aime Symfony2 - and for the ``en`` locale: .. configuration-block:: @@ -758,6 +759,11 @@ and for the ``en`` locale: + .. code-block:: yaml + + # src/Acme/AcmeDemoBundle/Resources/translations/messages.en.yml + Symfony2 is great: Symfony2 is great + .. code-block:: php // src/Acme/AcmeDemoBundle/Resources/translations/messages.en.php @@ -765,11 +771,6 @@ and for the ``en`` locale: 'Symfony2 is great' => 'Symfony2 is great', ); - .. code-block:: yaml - - # src/Acme/AcmeDemoBundle/Resources/translations/messages.en.yml - Symfony2 is great: Symfony2 is great - To inspect all messages in the ``fr`` locale for the AcmeDemoBundle, run: .. code-block:: bash From 49971fb7425ac0dedabc74bfa51e34d0f09b3396 Mon Sep 17 00:00:00 2001 From: WouterJ Date: Tue, 13 Jan 2015 14:58:04 +0100 Subject: [PATCH 10/16] Use path to be consistent --- cookbook/routing/custom_route_loader.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cookbook/routing/custom_route_loader.rst b/cookbook/routing/custom_route_loader.rst index b4c25110d1f..a6e682ffe70 100644 --- a/cookbook/routing/custom_route_loader.rst +++ b/cookbook/routing/custom_route_loader.rst @@ -85,14 +85,14 @@ type you want. The resource name itself is not actually used in the example:: $routes = new RouteCollection(); // prepare a new route - $pattern = '/extra/{parameter}'; + $path = '/extra/{parameter}'; $defaults = array( '_controller' => 'AcmeDemoBundle:Demo:extra', ); $requirements = array( 'parameter' => '\d+', ); - $route = new Route($pattern, $defaults, $requirements); + $route = new Route($path, $defaults, $requirements); // add the new route to the route collection: $routeName = 'extraRoute'; From 3a7d0f4848e53f14b665591123d38f6f7873e7f2 Mon Sep 17 00:00:00 2001 From: SofHad Date: Tue, 13 Jan 2015 17:02:37 +0100 Subject: [PATCH 11/16] Fixed typo --- cookbook/deployment/platformsh.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cookbook/deployment/platformsh.rst b/cookbook/deployment/platformsh.rst index a8c086f3ecd..1d73bfdc38a 100644 --- a/cookbook/deployment/platformsh.rst +++ b/cookbook/deployment/platformsh.rst @@ -144,7 +144,7 @@ command that you see on the Platform.sh web UI): ``PROJECT-ID`` Unique identifier of your project. Something like ``kjh43kbobssae`` ``CLUSTER`` - Server location where your project is deplyed. It can be ``eu`` or ``us`` + Server location where your project is deployed. It can be ``eu`` or ``us`` Commit the Platform.sh specific files created in the previous section: From cc7853de47805932282a7b5abcd96ce97ac8e9f7 Mon Sep 17 00:00:00 2001 From: SofHad Date: Tue, 13 Jan 2015 19:15:21 +0100 Subject: [PATCH 12/16] Fixed 404 page --- components/templating/helpers/slotshelper.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/templating/helpers/slotshelper.rst b/components/templating/helpers/slotshelper.rst index c264b2244e2..e368b83f86a 100644 --- a/components/templating/helpers/slotshelper.rst +++ b/components/templating/helpers/slotshelper.rst @@ -55,7 +55,7 @@ Extending Templates The :method:`Symfony\\Component\\Templating\\PhpEngine::extend` method is called in the sub-template to set its parent template. Then -:method:`$view['slots']->set() ` +:method:`$view['slots']->set() ` can be used to set the content of a slot. All content which is not explicitly set in a slot is in the ``_content`` slot. From c8a8b10d11b80e7077be7ecb1581430a809e6761 Mon Sep 17 00:00:00 2001 From: SofHad Date: Tue, 13 Jan 2015 22:36:13 +0100 Subject: [PATCH 13/16] Fixed 404 page --- components/templating/helpers/assetshelper.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/templating/helpers/assetshelper.rst b/components/templating/helpers/assetshelper.rst index ed4e681c19a..5ae45979725 100644 --- a/components/templating/helpers/assetshelper.rst +++ b/components/templating/helpers/assetshelper.rst @@ -104,4 +104,4 @@ Custom Packages --------------- You can create your own package by extending -:class:`Symfony\\Component\\Templating\\Package\\Package`. +:class:`Symfony\\Component\\Templating\\Asset\\Package`. From 05d1a64eaaeb8f91b7e4858322a315b0e2beb56f Mon Sep 17 00:00:00 2001 From: SofHad Date: Wed, 14 Jan 2015 14:07:40 +0100 Subject: [PATCH 14/16] Fixed broken link #4827 --- reference/dic_tags.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/reference/dic_tags.rst b/reference/dic_tags.rst index 833b4cc33d1..bdce845b312 100644 --- a/reference/dic_tags.rst +++ b/reference/dic_tags.rst @@ -618,7 +618,7 @@ kernel.terminate +-------------------------------------------------------------------------------------------+----------+ | Listener Class Name | Priority | +===========================================================================================+==========+ -| :class:`Symfony\\Bundle\\SwiftmailerBundle\\EventListener\\EmailSenderListener` | 0 | +| `EmailSenderListener`_ | 0 | +-------------------------------------------------------------------------------------------+----------+ .. _dic-tags-kernel-event-subscriber: @@ -1396,3 +1396,4 @@ For an example, see the ``EntityInitializer`` class inside the Doctrine Bridge. .. _`Twig official extension repository`: https://github.com/twigphp/Twig-extensions .. _`SwiftMailer's Plugin Documentation`: http://swiftmailer.org/docs/plugins.html .. _`Twig Loader`: http://twig.sensiolabs.org/doc/api.html#loaders +.. _`EmailSenderListener`: https://github.com/symfony/SwiftmailerBundle/blob/master/EventListener/EmailSenderListener.php From 449ee9a277ba714b1806fda30ba9b1ddfbc7566d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Miguel=20Benito=20Calzada?= Date: Thu, 15 Jan 2015 18:06:57 +0100 Subject: [PATCH 15/16] Fixed typo --- components/http_foundation/sessions.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/http_foundation/sessions.rst b/components/http_foundation/sessions.rst index 5c9d7accd94..430a83ac23c 100644 --- a/components/http_foundation/sessions.rst +++ b/components/http_foundation/sessions.rst @@ -46,7 +46,7 @@ Quick example:: .. note:: - While it is recommended to explicitly start a session, a sessions will actually + While it is recommended to explicitly start a session, a session will actually start on demand, that is, if any session request is made to read/write session data. From c243d0040a156536d414c0efafa8808f9ccccb2a Mon Sep 17 00:00:00 2001 From: WouterJ Date: Fri, 16 Jan 2015 17:51:00 +0100 Subject: [PATCH 16/16] minor #4843 Fixed typo (beni0888)