From 693ba241a4ca0f7ee54176ce33ba45c81f303a33 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sat, 29 Mar 2014 11:08:03 +0100 Subject: [PATCH 1/7] [book] [validation] fixed minor typos --- book/validation.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book/validation.rst b/book/validation.rst index 7ea256486c2..307420b2f8e 100644 --- a/book/validation.rst +++ b/book/validation.rst @@ -974,8 +974,8 @@ that group are valid, the second group, ``Strict``, will be validated. constraints that do not belong to any group. This means that you have to use the ``{ClassName}`` (e.g. ``User``) group - when specifing a group sequence. When using ``Default``, you get an - infinite recursion (as the ``Default`` groups references the group + when specifying a group sequence. When using ``Default``, you get an + infinite recursion (as the ``Default`` group references the group sequence, which will contain the ``Default`` group which references the same group sequence, ...). From a1f5cd6da5128a215dbd30345cd88a134cfe492c Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sat, 29 Mar 2014 11:12:22 +0100 Subject: [PATCH 2/7] [book] [testing] fixed the path of the phpunit.xml file Sometimes is referenced as phpunit.xml and other times as app/phpunit.xml I think that we should always use the explicit app/phpunit.xml path, except when explaining the phpunit.xml file in general. --- book/testing.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/book/testing.rst b/book/testing.rst index bad45c44b2f..4d1a635d08f 100644 --- a/book/testing.rst +++ b/book/testing.rst @@ -89,8 +89,8 @@ of your bundle:: directory, put the test in the ``Tests/Utility/`` directory. Just like in your real application - autoloading is automatically enabled -via the ``bootstrap.php.cache`` file (as configured by default in the ``phpunit.xml.dist`` -file). +via the ``bootstrap.php.cache`` file (as configured by default in the +``app/phpunit.xml.dist`` file). Running tests for a given file or directory is also very easy: @@ -777,12 +777,12 @@ machine only. .. tip:: - Store the ``phpunit.xml.dist`` file in your code repository and ignore the - ``phpunit.xml`` file. + Store the ``app/phpunit.xml.dist`` file in your code repository and ignore + the ``app/phpunit.xml`` file. By default, only the tests from your own custom bundles stored in the standard directories ``src/*/*Bundle/Tests`` or ``src/*/Bundle/*Bundle/Tests`` are run -by the ``phpunit`` command, as configured in the ``phpunit.xml.dist`` file: +by the ``phpunit`` command, as configured in the ``app/phpunit.xml.dist`` file: .. code-block:: xml From 9da7f9bb09046315d749dc9a9f6d98ce83f6b4e4 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Sat, 29 Mar 2014 11:19:10 +0100 Subject: [PATCH 3/7] [book] [controller] fixed the code of a session sample code This code was updated in the past to use the $request controller injection and the resulting code was a bit confusing. When you get the attribute set by another controller, it's better to use a different attribute name, to make it clear that it wasn't set at this controller. --- book/controller.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/book/controller.rst b/book/controller.rst index de17696b4a9..9ef18da08d3 100644 --- a/book/controller.rst +++ b/book/controller.rst @@ -666,10 +666,10 @@ from any controller:: // store an attribute for reuse during a later user request $session->set('foo', 'bar'); - // in another controller for another request - $foo = $session->get('foo'); + // get the attribute set by another controller in another request + $foobar = $session->get('foobar'); - // use a default value if the key doesn't exist + // use a default value if the attribute doesn't exist $filters = $session->get('filters', array()); } From 38b7f8297c96a6a86d8e1b675a09dafedf8f6ca2 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 28 Mar 2014 09:08:09 +0100 Subject: [PATCH 4/7] Added a note about inlined private services --- book/service_container.rst | 7 +++++++ components/dependency_injection/advanced.rst | 2 ++ 2 files changed, 9 insertions(+) diff --git a/book/service_container.rst b/book/service_container.rst index a036a6cae41..a26b8f447c1 100644 --- a/book/service_container.rst +++ b/book/service_container.rst @@ -1001,6 +1001,13 @@ By default only public services are shown, but you can also view private service $ php app/console container:debug --show-private +.. note:: + + If a private service is only used as an argument to just one other service, + it won't be displayed by the ``container:debug`` command, even when using + the ``--show-private`` option. See :ref:`inlined-private-services` for a + more detailed explanation. + You can get more detailed information about a particular service by specifying its id: diff --git a/components/dependency_injection/advanced.rst b/components/dependency_injection/advanced.rst index 7c139a7b734..db5fa9a04b2 100644 --- a/components/dependency_injection/advanced.rst +++ b/components/dependency_injection/advanced.rst @@ -18,6 +18,8 @@ However, there are use-cases when you don't want a service to be public. This is common when a service is only defined because it could be used as an argument for another service. +.. _inlined-private-services: + .. note:: If you use a private service as an argument to only one other service, From f14191b3ff1944283507b75ea8f43e23477b66cb Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Fri, 28 Mar 2014 09:47:09 +0100 Subject: [PATCH 5/7] Emphasized the fact that this only applies when the private service is used as argument for a single service --- book/service_container.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/book/service_container.rst b/book/service_container.rst index a26b8f447c1..8ee2d96b232 100644 --- a/book/service_container.rst +++ b/book/service_container.rst @@ -1003,7 +1003,7 @@ By default only public services are shown, but you can also view private service .. note:: - If a private service is only used as an argument to just one other service, + If a private service is only used as an argument to just *one* other service, it won't be displayed by the ``container:debug`` command, even when using the ``--show-private`` option. See :ref:`inlined-private-services` for a more detailed explanation. From 75d06e68ebad21e8e00458ab264c7413ad3992f7 Mon Sep 17 00:00:00 2001 From: Javier Eguiluz Date: Mon, 31 Mar 2014 12:02:12 +0200 Subject: [PATCH 6/7] added the title of a cross reference --- book/service_container.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/book/service_container.rst b/book/service_container.rst index 8ee2d96b232..29248f6d60b 100644 --- a/book/service_container.rst +++ b/book/service_container.rst @@ -1005,8 +1005,8 @@ By default only public services are shown, but you can also view private service If a private service is only used as an argument to just *one* other service, it won't be displayed by the ``container:debug`` command, even when using - the ``--show-private`` option. See :ref:`inlined-private-services` for a - more detailed explanation. + the ``--show-private`` option. See :ref:`Inline Private Services ` + for more details. You can get more detailed information about a particular service by specifying its id: From 1dd9b756ce6f9011f41e7075c39221e4ef66188e Mon Sep 17 00:00:00 2001 From: ackerman Date: Fri, 28 Mar 2014 18:58:53 -0400 Subject: [PATCH 7/7] Update routing.rst. Explain using url() v. path(). --- book/routing.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/book/routing.rst b/book/routing.rst index a6a1504c00a..911a90d5b50 100644 --- a/book/routing.rst +++ b/book/routing.rst @@ -1240,7 +1240,9 @@ method:: $this->generateUrl('blog_show', array('slug' => 'my-blog-post'), true); // http://www.example.com/blog/my-blog-post -From a template, it looks like this: +From a template, in Twig, simply use the ``url()`` function (which generates an absolute URL) +rather than the ``path()`` function (which generates a relative URL). In PHP, pass ``true`` +to ``generateUrl()``: .. configuration-block::