Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 61ea87b

Browse filesBrowse files
committed
Merge branch '2.6' into 2.7
* 2.6: Remove 'acme' Update routing.rst Typo Update introduction.rst [Book][Translation] Added tip for routing params [varnish] be more precise about version differences Remove trailing whitespace [BestPractices] fix minor typo Remove horizontal scrollbar [Components][Debug] fix DebugClassLoader namespace Update override.rst Update override.rst [Book][Security] add back old anchors [Cookbook][Security] Hint about createToken can return null Add version added note for the debug:event-dispatcher command
2 parents a5addaa + b0d2263 commit 61ea87b
Copy full SHA for 61ea87b
Expand file treeCollapse file tree

34 files changed

+138
-95
lines changed

‎best_practices/security.rst

Copy file name to clipboardExpand all lines: best_practices/security.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ Security Voters
245245

246246
If your security logic is complex and can't be centralized into a method
247247
like ``isAuthor()``, you should leverage custom voters. These are an order
248-
of magnitude easier than :doc:`ACL's </cookbook/security/acl>` and will give
248+
of magnitude easier than :doc:`ACLs </cookbook/security/acl>` and will give
249249
you the flexibility you need in almost all cases.
250250

251251
First, create a voter class. The following example shows a voter that implements

‎book/controller.rst

Copy file name to clipboardExpand all lines: book/controller.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ Symfony will automatically return a 500 HTTP response code.
559559
throw new \Exception('Something went wrong!');
560560
561561
In every case, an error page is shown to the end user and a full debug
562-
error page is shown to the developer (i.e. when you're using ``app_dev.php`` -
562+
error page is shown to the developer (i.e. when you're using ``app_dev.php`` -
563563
see :ref:`page-creation-environments`).
564564

565565
You'll want to customize the error page your user sees. To do that, see the

‎book/from_flat_php_to_symfony2.rst

Copy file name to clipboardExpand all lines: book/from_flat_php_to_symfony2.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ the layout:
244244

245245
<?php include 'layout.php' ?>
246246

247-
You now have a setup that will allow you to reuse the layout.
247+
You now have a setup that will allow you to reuse the layout.
248248
Unfortunately, to accomplish this, you're forced to use a few ugly
249249
PHP functions (``ob_start()``, ``ob_get_clean()``) in the template. Symfony
250250
uses a Templating component that allows this to be accomplished cleanly

‎book/http_cache.rst

Copy file name to clipboardExpand all lines: book/http_cache.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,8 @@ won't be asked to return the updated response until the cache finally becomes
538538
stale.
539539

540540
The validation model addresses this issue. Under this model, the cache continues
541-
to store responses. The difference is that, for each request, the cache asks the
542-
application if the cached response is still valid or if it needs to be regenerated.
541+
to store responses. The difference is that, for each request, the cache asks the
542+
application if the cached response is still valid or if it needs to be regenerated.
543543
If the cache *is* still valid, your application should return a 304 status code
544544
and no content. This tells the cache that it's ok to return the cached response.
545545

‎book/routing.rst

Copy file name to clipboardExpand all lines: book/routing.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,8 +1021,8 @@ routing system can be:
10211021
/**
10221022
* @Route(
10231023
* "/articles/{_locale}/{year}/{title}.{_format}",
1024-
* defaults: {"_format": "html"},
1025-
* requirements: {
1024+
* defaults={"_format": "html"},
1025+
* requirements={
10261026
* "_locale": "en|fr",
10271027
* "_format": "html|rss",
10281028
* "year": "\d+"

‎book/security.rst

Copy file name to clipboardExpand all lines: book/security.rst
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ But who can you login as? Where do users come from?
275275
or :doc:`build your own </cookbook/security/custom_authentication_provider>`.
276276

277277
.. _security-user-providers:
278+
.. _where-do-users-come-from-user-providers:
278279

279280
B) Configuring how Users are Loaded
280281
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -433,6 +434,7 @@ If you'd like to load your users via the Doctrine ORM, that's easy! See
433434

434435
.. _book-security-encoding-user-password:
435436
.. _c-encoding-the-users-password:
437+
.. _encoding-the-user-s-password:
436438

437439
C) Encoding the User's Password
438440
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

‎book/service_container.rst

Copy file name to clipboardExpand all lines: book/service_container.rst
+5-5Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ the service container gives you a much more appealing option:
569569
services:
570570
my_mailer:
571571
# ...
572-
572+
573573
newsletter_manager:
574574
class: Acme\HelloBundle\Newsletter\NewsletterManager
575575
arguments: ["@my_mailer"]
@@ -762,7 +762,7 @@ Injecting the dependency by the setter method just needs a change of syntax:
762762
services:
763763
my_mailer:
764764
# ...
765-
765+
766766
newsletter_manager:
767767
class: Acme\HelloBundle\Newsletter\NewsletterManager
768768
calls:
@@ -797,7 +797,7 @@ Injecting the dependency by the setter method just needs a change of syntax:
797797
use Symfony\Component\DependencyInjection\Reference;
798798
799799
$container->setDefinition('my_mailer', ...);
800-
800+
801801
$container->setDefinition('newsletter_manager', new Definition(
802802
'Acme\HelloBundle\Newsletter\NewsletterManager'
803803
))->addMethodCall('setMailer', array(
@@ -938,7 +938,7 @@ it exists and do nothing if it doesn't:
938938
<service id="my_mailer">
939939
<!-- ... -->
940940
</service>
941-
941+
942942
<service id="newsletter_manager" class="Acme\HelloBundle\Newsletter\NewsletterManager">
943943
<argument type="service" id="my_mailer" on-invalid="ignore" />
944944
</service>
@@ -953,7 +953,7 @@ it exists and do nothing if it doesn't:
953953
use Symfony\Component\DependencyInjection\ContainerInterface;
954954
955955
$container->setDefinition('my_mailer', ...);
956-
956+
957957
$container->setDefinition('newsletter_manager', new Definition(
958958
'Acme\HelloBundle\Newsletter\NewsletterManager',
959959
array(

‎book/translation.rst

Copy file name to clipboardExpand all lines: book/translation.rst
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ via the ``request`` object::
428428

429429
.. tip::
430430

431-
Read :doc:`/cookbook/session/locale_sticky_session` to learn, how to store
431+
Read :doc:`/cookbook/session/locale_sticky_session` to learn how to store
432432
the user's locale in the session.
433433

434434
.. index::
@@ -508,6 +508,11 @@ as the locale for the current request.
508508
You can now use the locale to create routes to other translated pages
509509
in your application.
510510

511+
.. tip::
512+
513+
Read :doc:`/cookbook/routing/service_container_parameters` to learn how to
514+
avoid hardcoding the ``_locale`` requirement in all your routes.
515+
511516
Setting a default Locale
512517
~~~~~~~~~~~~~~~~~~~~~~~~
513518

‎components/class_loader/cache_class_loader.rst

Copy file name to clipboardExpand all lines: components/class_loader/cache_class_loader.rst
+9-9Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
single: ClassLoader; Cache
55
single: ClassLoader; XcacheClassLoader
66
single: XCache; XcacheClassLoader
7-
7+
88
Cache a Class Loader
99
====================
1010

@@ -30,16 +30,16 @@ ApcClassLoader
3030
``findFile()`` method using `APC`_::
3131

3232
require_once '/path/to/src/Symfony/Component/ClassLoader/ApcClassLoader.php';
33-
33+
3434
// instance of a class that implements a findFile() method, like the ClassLoader
3535
$loader = ...;
36-
36+
3737
// sha1(__FILE__) generates an APC namespace prefix
3838
$cachedLoader = new ApcClassLoader(sha1(__FILE__), $loader);
39-
39+
4040
// register the cached class loader
4141
$cachedLoader->register();
42-
42+
4343
// deactivate the original, non-cached loader if it was registered previously
4444
$loader->unregister();
4545

@@ -50,16 +50,16 @@ XcacheClassLoader
5050
it is straightforward::
5151

5252
require_once '/path/to/src/Symfony/Component/ClassLoader/XcacheClassLoader.php';
53-
53+
5454
// instance of a class that implements a findFile() method, like the ClassLoader
5555
$loader = ...;
56-
56+
5757
// sha1(__FILE__) generates an XCache namespace prefix
5858
$cachedLoader = new XcacheClassLoader(sha1(__FILE__), $loader);
59-
59+
6060
// register the cached class loader
6161
$cachedLoader->register();
62-
62+
6363
// deactivate the original, non-cached loader if it was registered previously
6464
$loader->unregister();
6565

‎components/class_loader/map_class_loader.rst

Copy file name to clipboardExpand all lines: components/class_loader/map_class_loader.rst
+4-4Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
.. index::
22
single: ClassLoader; MapClassLoader
3-
3+
44
MapClassLoader
55
==============
66

@@ -26,14 +26,14 @@ Using it is as easy as passing your mapping to its constructor when creating
2626
an instance of the ``MapClassLoader`` class::
2727

2828
require_once '/path/to/src/Symfony/Component/ClassLoader/MapClassLoader';
29-
29+
3030
$mapping = array(
3131
'Foo' => '/path/to/Foo',
3232
'Bar' => '/path/to/Bar',
3333
);
34-
34+
3535
$loader = new MapClassLoader($mapping);
36-
36+
3737
$loader->register();
3838

3939
.. _PSR-0: http://www.php-fig.org/psr/psr-0/

‎components/console/introduction.rst

Copy file name to clipboardExpand all lines: components/console/introduction.rst
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,6 @@ tools capable of helping you with different tasks:
404404
* :doc:`/components/console/helpers/formatterhelper`: customize the output colorization
405405
* :doc:`/components/console/helpers/progressbar`: shows a progress bar
406406
* :doc:`/components/console/helpers/table`: displays tabular data as a table
407-
* :doc:`/components/console/helpers/questionhelper`: interactively ask the user for information
408407

409408
.. _component-console-testing-commands:
410409

‎components/css_selector.rst

Copy file name to clipboardExpand all lines: components/css_selector.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ web-browser.
7676

7777
* link-state selectors: ``:link``, ``:visited``, ``:target``
7878
* selectors based on user action: ``:hover``, ``:focus``, ``:active``
79-
* UI-state selectors: ``:invalid``, ``:indeterminate`` (however, ``:enabled``,
79+
* UI-state selectors: ``:invalid``, ``:indeterminate`` (however, ``:enabled``,
8080
``:disabled``, ``:checked`` and ``:unchecked`` are available)
8181

8282
Pseudo-elements (``:before``, ``:after``, ``:first-line``,

‎components/debug/class_loader.rst

Copy file name to clipboardExpand all lines: components/debug/class_loader.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ with a ``DebugClassLoader`` wrapper.
1313
Using the ``DebugClassLoader`` is as easy as calling its static
1414
:method:`Symfony\\Component\\Debug\\DebugClassLoader::enable` method::
1515

16-
use Symfony\Component\ClassLoader\DebugClassLoader;
16+
use Symfony\Component\Debug\DebugClassLoader;
1717

1818
DebugClassLoader::enable();

‎components/dependency_injection/advanced.rst

Copy file name to clipboardExpand all lines: components/dependency_injection/advanced.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ using the ``get()`` method::
1717

1818
In some cases, a service *only* exists to be injected into another service
1919
and is *not* intended to be fetched directly from the container as shown
20-
above.
20+
above.
2121

2222
.. _inlined-private-services:
2323

‎components/security/authentication.rst

Copy file name to clipboardExpand all lines: components/security/authentication.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ in) is correct, you can use::
263263

264264
// fetch the Acme\Entity\LegacyUser
265265
$user = ...;
266-
266+
267267
// the submitted password, e.g. from the login form
268268
$plainPassword = ...;
269269

‎components/templating/helpers/assetshelper.rst

Copy file name to clipboardExpand all lines: components/templating/helpers/assetshelper.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ Asset path generation is handled internally by packages. The component provides
9999
You can also use multiple packages::
100100

101101
use Symfony\Component\Templating\Asset\PathPackage;
102-
102+
103103
// ...
104104
$templateEngine->set(new AssetsHelper());
105105

‎components/templating/introduction.rst

Copy file name to clipboardExpand all lines: components/templating/introduction.rst
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ escaper using the
135135
Helpers
136136
-------
137137

138-
The Templating component can be easily extended via helpers. Helpers are PHP objects that
138+
The Templating component can be easily extended via helpers. Helpers are PHP objects that
139139
provide features useful in a template context. The component has
140140
2 built-in helpers:
141141

‎contributing/code/standards.rst

Copy file name to clipboardExpand all lines: contributing/code/standards.rst
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ example containing most features described below:
7979

8080
throw new \RuntimeException(sprintf('Unrecognized dummy option "%s"', $dummy));
8181
}
82-
82+
8383
private function reverseBoolean($value = null, $theSwitch = false)
8484
{
8585
if (!$theSwitch) {
@@ -95,7 +95,7 @@ Structure
9595

9696
* Add a single space after each comma delimiter;
9797

98-
* Add a single space around binary operators (``==``, ``&&``, ...), with
98+
* Add a single space around binary operators (``==``, ``&&``, ...), with
9999
the exception of the concatenation (``.``) operator;
100100

101101
* Place unary operators (``!``, ``--``, ...) adjacent to the affected variable;

‎cookbook/bundles/override.rst

Copy file name to clipboardExpand all lines: cookbook/bundles/override.rst
+14-7Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ the routes from any bundle, then they must be manually imported from somewhere
2323
in your application (e.g. ``app/config/routing.yml``).
2424

2525
The easiest way to "override" a bundle's routing is to never import it at
26-
all. Instead of importing a third-party bundle's routing, simply copying
26+
all. Instead of importing a third-party bundle's routing, simply copy
2727
that routing file into your application, modify it, and import it instead.
2828

2929
Controllers
@@ -68,7 +68,7 @@ in the core FrameworkBundle:
6868
$container->setParameter('translator.class', 'Acme\HelloBundle\Translation\Translator');
6969
7070
Secondly, if the class is not available as a parameter, you want to make sure the
71-
class is always overridden when your bundle is used, or you need to modify
71+
class is always overridden when your bundle is used or if you need to modify
7272
something beyond just the class name, you should use a compiler pass::
7373

7474
// src/Acme/DemoBundle/DependencyInjection/Compiler/OverrideServiceCompilerPass.php
@@ -106,7 +106,7 @@ Forms
106106
-----
107107

108108
In order to override a form type, it has to be registered as a service (meaning
109-
it is tagged as "form.type"). You can then override it as you would override any
109+
it is tagged as ``form.type``). You can then override it as you would override any
110110
service as explained in `Services & Configuration`_. This, of course, will only
111111
work if the type is referred to by its alias rather than being instantiated,
112112
e.g.::
@@ -136,7 +136,7 @@ the constraints to a new validation group:
136136
.. code-block:: yaml
137137
138138
# src/Acme/UserBundle/Resources/config/validation.yml
139-
Fos\UserBundle\Model\User:
139+
FOS\UserBundle\Model\User:
140140
properties:
141141
plainPassword:
142142
- NotBlank:
@@ -152,10 +152,17 @@ the constraints to a new validation group:
152152
<?xml version="1.0" encoding="UTF-8" ?>
153153
<constraint-mapping xmlns="http://symfony.com/schema/dic/constraint-mapping"
154154
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
155-
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">
155+
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping
156+
http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">
157+
158+
<class name="FOS\UserBundle\Model\User">
159+
<property name="plainPassword">
160+
<constraint name="NotBlank">
161+
<option name="groups">
162+
<value>AcmeValidation</value>
163+
</option>
164+
</constraint>
156165
157-
<class name="Fos\UserBundle\Model\User">
158-
<property name="password">
159166
<constraint name="Length">
160167
<option name="min">6</option>
161168
<option name="minMessage">fos_user.password.short</option>

‎cookbook/cache/varnish.rst

Copy file name to clipboardExpand all lines: cookbook/cache/varnish.rst
+14-5Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ Ensure Consistent Caching Behaviour
6565

6666
Varnish uses the cache headers sent by your application to determine how
6767
to cache content. However, versions prior to Varnish 4 did not respect
68-
``Cache-Control: no-cache``. To ensure consistent behaviour, use the following
69-
configuration if you are still using Varnish 3:
68+
``Cache-Control: no-cache``, ``no-store`` and ``private``. To ensure
69+
consistent behavior, use the following configuration if you are still
70+
using Varnish 3:
7071

7172
.. configuration-block::
7273

@@ -76,13 +77,19 @@ configuration if you are still using Varnish 3:
7677
/* By default, Varnish3 ignores Cache-Control: no-cache and private
7778
https://www.varnish-cache.org/docs/3.0/tutorial/increasing_your_hitrate.html#cache-control
7879
*/
79-
if (beresp.http.Cache-Control ~ "no-cache" ||
80-
beresp.http.Cache-Control ~ "private"
80+
if (beresp.http.Cache-Control ~ "private" ||
81+
beresp.http.Cache-Control ~ "no-cache" ||
82+
beresp.http.Cache-Control ~ "no-store"
8183
) {
8284
return (hit_for_pass);
8385
}
8486
}
8587
88+
.. tip::
89+
90+
You can see the default behavior of Varnish in the form of a VCL file:
91+
`default.vcl`_ for Varnish 3, `builtin.vcl`_ for Varnish 4.
92+
8693
Enable Edge Side Includes (ESI)
8794
-------------------------------
8895

@@ -143,7 +150,7 @@ Symfony adds automatically:
143150
.. tip::
144151

145152
If you followed the advice about ensuring a consistent caching
146-
behaviour, those vcl functions already exist. Just append the code
153+
behavior, those vcl functions already exist. Just append the code
147154
to the end of the function, they won't interfere with each other.
148155

149156
.. index::
@@ -172,3 +179,5 @@ proxy before it has expired, it adds complexity to your caching setup.
172179
.. _`Surrogate-Capability Header`: http://www.w3.org/TR/edge-arch
173180
.. _`cache invalidation`: http://tools.ietf.org/html/rfc2616#section-13.10
174181
.. _`FOSHttpCacheBundle`: http://foshttpcachebundle.readthedocs.org/
182+
.. _`default.vcl`: https://www.varnish-cache.org/trac/browser/bin/varnishd/default.vcl?rev=3.0
183+
.. _`builtin.vcl`: https://www.varnish-cache.org/trac/browser/bin/varnishd/builtin.vcl?rev=4.0

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.