From 6c4421b2a30806fabd8b6e5001882aedc9d3dcb4 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 11 Jun 2014 18:20:17 +0200 Subject: [PATCH 1/5] properly escape backslashes in class and method directives --- book/security.rst | 2 +- components/class_loader/psr4_class_loader.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/book/security.rst b/book/security.rst index fb0f7884dfb..0572bc13330 100644 --- a/book/security.rst +++ b/book/security.rst @@ -1105,7 +1105,7 @@ authorization from inside a controller:: The ``createAccessDeniedException`` method was introduced in Symfony 2.5. The :method:`Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller::createAccessDeniedException` -method creates a special :class:`Symfony\\Component\\Security\\Core\Exception\\AccessDeniedException` +method creates a special :class:`Symfony\\Component\\Security\\Core\\Exception\\AccessDeniedException` object, which ultimately triggers a 403 HTTP response inside Symfony. Thanks to the SensioFrameworkExtraBundle, you can also secure your controller using annotations:: diff --git a/components/class_loader/psr4_class_loader.rst b/components/class_loader/psr4_class_loader.rst index 489db8a351d..e388590310d 100644 --- a/components/class_loader/psr4_class_loader.rst +++ b/components/class_loader/psr4_class_loader.rst @@ -59,7 +59,7 @@ first need to configure the ``Psr4ClassLoader``: First of all, the class loader is loaded manually using a ``require`` statement, since there is no autoload mechanism yet. With the -:method:`Symfony\Component\ClassLoader\Psr4ClassLoader::addPrefix` call, you +:method:`Symfony\\Component\\ClassLoader\\Psr4ClassLoader::addPrefix` call, you tell the class loader where to look for classes with the ``Symfony\Component\Yaml\`` namespace prefix. After registering the autoloader, the Yaml component is ready to be used. From 301e44b85cd323c9791a95b9874bd7bb76be552a Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Wed, 11 Jun 2014 11:52:46 +0200 Subject: [PATCH 2/5] don't render the list inside a blockquote --- contributing/documentation/license.rst | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/contributing/documentation/license.rst b/contributing/documentation/license.rst index ccbda535dec..c8bce4bdaea 100644 --- a/contributing/documentation/license.rst +++ b/contributing/documentation/license.rst @@ -32,13 +32,13 @@ Attribution-Share Alike 3.0 Unported `License`_. * *Other Rights* — In no way are any of the following rights affected by the license: - * Your fair dealing or fair use rights, or other applicable copyright - exceptions and limitations; + * Your fair dealing or fair use rights, or other applicable copyright exceptions + and limitations; - * The author's moral rights; + * The author's moral rights; - * Rights other persons may have either in the work itself or in how - the work is used, such as publicity or privacy rights. + * Rights other persons may have either in the work itself or in how the + work is used, such as publicity or privacy rights. * *Notice* — For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link From dfcfb3a017e1d050993347b210d7bee35b9beb5f Mon Sep 17 00:00:00 2001 From: Gonzalo Vilaseca Date: Wed, 11 Jun 2014 15:45:24 +0100 Subject: [PATCH 3/5] Varnish only takes into account max-age Varnish only takes into account max-age, Symfony by default returns Cache-Control: no-cache so Varnish caches it anyway. You need to specify: ``` if (beresp.http.Pragma ~ "no-cache" || beresp.http.Cache-Control ~ "no-cache" || beresp.http.Cache-Control ~ "private") { return (hit_for_pass); } ``` In order to avoid Varnish from caching content. --- cookbook/cache/varnish.rst | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cookbook/cache/varnish.rst b/cookbook/cache/varnish.rst index 48eb43c2592..477809ca74b 100644 --- a/cookbook/cache/varnish.rst +++ b/cookbook/cache/varnish.rst @@ -57,6 +57,12 @@ Symfony2 adds automatically: // For Varnish < 3.0 // esi; } + /* Do not cache if no-cache is found in headers */ + if (beresp.http.Pragma ~ "no-cache" || + beresp.http.Cache-Control ~ "no-cache" || + beresp.http.Cache-Control ~ "private") { + return (hit_for_pass); + } } .. caution:: From 3998e2f5eb6cfee54a26a7ad6e0de52ed020d6fb Mon Sep 17 00:00:00 2001 From: Gonzalo Vilaseca Date: Wed, 11 Jun 2014 17:12:59 +0100 Subject: [PATCH 4/5] Update varnish.rst --- cookbook/cache/varnish.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cookbook/cache/varnish.rst b/cookbook/cache/varnish.rst index 477809ca74b..6794793e83d 100644 --- a/cookbook/cache/varnish.rst +++ b/cookbook/cache/varnish.rst @@ -57,7 +57,8 @@ Symfony2 adds automatically: // For Varnish < 3.0 // esi; } - /* Do not cache if no-cache is found in headers */ + /* By default Varnish ignores Cache-Control: nocache (https://www.varnish-cache.org/docs/3.0/tutorial/increasing_your_hitrate.html#cache-control), + so in order avoid caching it has to be done explicitly */ if (beresp.http.Pragma ~ "no-cache" || beresp.http.Cache-Control ~ "no-cache" || beresp.http.Cache-Control ~ "private") { From 3a94e1f0747b7a85b8e1c12f6296fd58210e393b Mon Sep 17 00:00:00 2001 From: Gonzalo Vilaseca Date: Wed, 11 Jun 2014 18:43:31 +0100 Subject: [PATCH 5/5] Update varnish.rst --- cookbook/cache/varnish.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cookbook/cache/varnish.rst b/cookbook/cache/varnish.rst index 6794793e83d..da06add99f1 100644 --- a/cookbook/cache/varnish.rst +++ b/cookbook/cache/varnish.rst @@ -57,7 +57,8 @@ Symfony2 adds automatically: // For Varnish < 3.0 // esi; } - /* By default Varnish ignores Cache-Control: nocache (https://www.varnish-cache.org/docs/3.0/tutorial/increasing_your_hitrate.html#cache-control), + /* By default Varnish ignores Cache-Control: nocache + (https://www.varnish-cache.org/docs/3.0/tutorial/increasing_your_hitrate.html#cache-control), so in order avoid caching it has to be done explicitly */ if (beresp.http.Pragma ~ "no-cache" || beresp.http.Cache-Control ~ "no-cache" ||