Skip to content

Commit a7360ed

Browse files
committed
Merge branch '2.8' into 3.2
* 2.8: (24 commits) Update optional_dependencies.rst Fix xml blocks pass only strings to loadUserByUsername() Fix Authenticator Class (getCredentials) example Added the picture that shows how GuardAuthenticationListener calls Authentication Guard methods. [#7875] minor tweaks Minor fix Minor changes [#7773] fix line length Add helpful remarks on custom DataCollector Remove use of deprecated security.exception_listener.class parameter Update resources.rst Fix incoherent ut8mb4 collation in Doctrine setup Fix decorating service definition fix empty XML element [#7873] add missing toctree entries Reworded the introduction of the contributing docs [HttpFoundation] Fix clearstatcache first arg Explain how to provide a stack trace Add link to the Slack support channel ...
2 parents e1b48e9 + 9ddaba3 commit a7360ed

File tree

96 files changed

+1181
-578
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+1181
-578
lines changed
Loading

bundles/best_practices.rst

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -348,9 +348,17 @@ The end user can provide values in any configuration file:
348348
.. code-block:: xml
349349
350350
<!-- app/config/config.xml -->
351-
<parameters>
352-
<parameter key="acme_blog.author.email">[email protected]</parameter>
353-
</parameters>
351+
<?xml version="1.0" encoding="UTF-8" ?>
352+
<container xmlns="http://symfony.com/schema/dic/services"
353+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
354+
xsi:schemaLocation="http://symfony.com/schema/dic/services
355+
http://symfony.com/schema/dic/services/services-1.0.xsd">
356+
357+
<parameters>
358+
<parameter key="acme_blog.author.email">[email protected]</parameter>
359+
</parameters>
360+
361+
</container>
354362
355363
.. code-block:: php
356364

bundles/configuration.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ thrown)::
225225
$configuration = new Configuration();
226226

227227
$config = $this->processConfiguration($configuration, $configs);
228-
228+
229229
// you now have these 2 config keys
230230
// $config['twitter']['client_id'] and $config['twitter']['client_secret']
231231
}
@@ -424,7 +424,6 @@ Assuming the XSD file is called ``hello-1.0.xsd``, the schema location will be
424424
425425
<!-- app/config/config.xml -->
426426
<?xml version="1.0" ?>
427-
428427
<container xmlns="http://symfony.com/schema/dic/services"
429428
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
430429
xmlns:acme-hello="http://acme_company.com/schema/dic/hello"

bundles/prepend_extension.rst

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ users to choose to remove functionality they are not using. Creating multiple
1212
bundles has the drawback that configuration becomes more tedious and settings
1313
often need to be repeated for various bundles.
1414

15-
It is possible to remove the disadvantage of the multiple bundle approach
15+
It is possible to remove the disadvantage of the multiple bundle approach
1616
by enabling a single Extension to prepend the settings for any bundle.
1717
It can use the settings defined in the ``app/config/config.yml``
1818
to prepend settings just as if they had been written explicitly by
@@ -116,11 +116,21 @@ The above would be the equivalent of writing the following into the
116116
.. code-block:: xml
117117
118118
<!-- app/config/config.xml -->
119-
<acme-something:config use-acme-goodbye="false">
120-
<acme-something:entity-manager-name>non_default</acme-something:entity-manager-name>
121-
</acme-something:config>
119+
<?xml version="1.0" encoding="UTF-8" ?>
120+
<container xmlns="http://symfony.com/schema/dic/services"
121+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
122+
xmlns:acme-something="http://example.org/schema/dic/acme_something"
123+
xmlns:acme-other="http://example.org/schema/dic/acme_other"
124+
xsi:schemaLocation="http://symfony.com/schema/dic/services
125+
http://symfony.com/schema/dic/services/services-1.0.xsd">
122126
123-
<acme-other:config use-acme-goodbye="false" />
127+
<acme-something:config use-acme-goodbye="false">
128+
<acme-something:entity-manager-name>non_default</acme-something:entity-manager-name>
129+
</acme-something:config>
130+
131+
<acme-other:config use-acme-goodbye="false" />
132+
133+
</container>
124134
125135
.. code-block:: php
126136

components/http_foundation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ Please note that this will not work when the ``X-Sendfile`` header is set.
523523

524524
If you *just* created the file during this same request, the file *may* be sent
525525
without any content. This may be due to cached file stats that return zero for
526-
the size of the file. To fix this issue, call ``clearstatcache(false, $file)``
526+
the size of the file. To fix this issue, call ``clearstatcache(true, $file)``
527527
with the path to the binary file.
528528

529529
.. _component-http-foundation-json-response:

components/validator/resources.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ In this example, the validation metadata is retrieved executing the
4545
public static function loadValidatorMetadata(ClassMetadata $metadata)
4646
{
4747
$metadata->addPropertyConstraint('name', new Assert\NotBlank());
48-
$metadata->addPropertyConstraint('name', new Asert\Length(array(
48+
$metadata->addPropertyConstraint('name', new Assert\Length(array(
4949
'min' => 5,
5050
'max' => 20,
5151
)));

configuration/environments.rst

Lines changed: 60 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,22 @@ accomplished easily and transparently:
6969
7070
.. code-block:: xml
7171
72-
<imports>
73-
<import resource="config.xml" />
74-
</imports>
72+
<?xml version="1.0" encoding="UTF-8" ?>
73+
<container xmlns="http://symfony.com/schema/dic/services"
74+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
75+
xmlns:doctrine="http://symfony.com/schema/dic/doctrine"
76+
xsi:schemaLocation="http://symfony.com/schema/dic/services
77+
http://symfony.com/schema/dic/services/services-1.0.xsd
78+
http://symfony.com/schema/dic/doctrine
79+
http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd">
7580
76-
<!-- ... -->
81+
<imports>
82+
<import resource="config.xml" />
83+
</imports>
84+
85+
<!-- ... -->
86+
87+
</container>
7788
7889
.. code-block:: php
7990
@@ -104,11 +115,22 @@ configuration file:
104115
.. code-block:: xml
105116
106117
<!-- app/config/config_dev.xml -->
107-
<imports>
108-
<import resource="config.xml" />
109-
</imports>
118+
<?xml version="1.0" encoding="UTF-8" ?>
119+
<container xmlns="http://symfony.com/schema/dic/services"
120+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
121+
xmlns:webprofiler="http://symfony.com/schema/dic/webprofiler"
122+
xsi:schemaLocation="http://symfony.com/schema/dic/services
123+
http://symfony.com/schema/dic/services/services-1.0.xsd
124+
http://symfony.com/schema/dic/webprofiler
125+
http://symfony.com/schema/dic/webprofiler/webprofiler-1.0.xsd">
126+
127+
<imports>
128+
<import resource="config.xml" />
129+
</imports>
130+
131+
<webprofiler:config toolbar="true" />
110132
111-
<webprofiler:config toolbar="true" />
133+
</container>
112134
113135
.. code-block:: php
114136
@@ -201,7 +223,18 @@ this code and changing the environment string.
201223
202224
.. code-block:: xml
203225
204-
<doctrine:dbal logging="%kernel.debug%" />
226+
<?xml version="1.0" encoding="UTF-8" ?>
227+
<container xmlns="http://symfony.com/schema/dic/services"
228+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
229+
xmlns:doctrine="http://symfony.com/schema/dic/doctrine"
230+
xsi:schemaLocation="http://symfony.com/schema/dic/services
231+
http://symfony.com/schema/dic/services/services-1.0.xsd
232+
http://symfony.com/schema/dic/doctrine
233+
http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd">
234+
235+
<doctrine:dbal logging="%kernel.debug%" />
236+
237+
</container>
205238
206239
.. code-block:: php
207240
@@ -279,13 +312,24 @@ The best way to accomplish this is via a new environment called, for example,
279312
.. code-block:: xml
280313
281314
<!-- app/config/config_benchmark.xml -->
282-
<imports>
283-
<import resource="config_prod.xml" />
284-
</imports>
285-
286-
<framework:config>
287-
<framework:profiler only-exceptions="false" />
288-
</framework:config>
315+
<?xml version="1.0" encoding="UTF-8" ?>
316+
<container xmlns="http://symfony.com/schema/dic/services"
317+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
318+
xmlns:framework="http://symfony.com/schema/dic/symfony"
319+
xsi:schemaLocation="http://symfony.com/schema/dic/services
320+
http://symfony.com/schema/dic/services/services-1.0.xsd
321+
http://symfony.com/schema/dic/symfony
322+
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
323+
324+
<imports>
325+
<import resource="config_prod.xml" />
326+
</imports>
327+
328+
<framework:config>
329+
<framework:profiler only-exceptions="false" />
330+
</framework:config>
331+
332+
</container>
289333
290334
.. code-block:: php
291335

configuration/external_parameters.rst

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,22 @@ variable in your service container configuration, you can reference it using
3737
.. code-block:: xml
3838
3939
<!-- app/config/config.xml -->
40-
<!-- xmlns:doctrine="http://symfony.com/schema/dic/doctrine" -->
41-
<!-- xsi:schemaLocation="http://symfony.com/schema/dic/doctrine http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd"> -->
40+
<?xml version="1.0" encoding="UTF-8" ?>
41+
<container xmlns="http://symfony.com/schema/dic/services"
42+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
43+
xmlns:doctrine="http://symfony.com/schema/dic/doctrine"
44+
xsi:schemaLocation="http://symfony.com/schema/dic/services
45+
http://symfony.com/schema/dic/services/services-1.0.xsd
46+
http://symfony.com/schema/dic/doctrine
47+
http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd">
4248
43-
<doctrine:config>
44-
<doctrine:dbal
45-
host="%env(DATABASE_HOST)%"
46-
/>
47-
</doctrine:config>
49+
<doctrine:config>
50+
<doctrine:dbal
51+
host="%env(DATABASE_HOST)%"
52+
/>
53+
</doctrine:config>
54+
55+
</container>
4856
4957
.. code-block:: php
5058
@@ -145,9 +153,17 @@ in the container. The following imports a file named ``parameters.php``.
145153
.. code-block:: xml
146154
147155
<!-- app/config/config.xml -->
148-
<imports>
149-
<import resource="parameters.php" />
150-
</imports>
156+
<?xml version="1.0" encoding="UTF-8" ?>
157+
<container xmlns="http://symfony.com/schema/dic/services"
158+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
159+
xsi:schemaLocation="http://symfony.com/schema/dic/services
160+
http://symfony.com/schema/dic/services/services-1.0.xsd">
161+
162+
<imports>
163+
<import resource="parameters.php" />
164+
</imports>
165+
166+
</container>
151167
152168
.. code-block:: php
153169

configuration/override_dir_structure.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ define your own templates directory (or directories):
121121
<twig:config>
122122
<twig:path>%kernel.root_dir%/../templates</twig:path>
123123
</twig:config>
124+
124125
</container>
125126
126127
.. code-block:: php
@@ -197,6 +198,7 @@ You also need to change the ``extra.symfony-web-dir`` option in the
197198
198199
<!-- ... -->
199200
<assetic:config read-from="%kernel.root_dir%/../../public_html" />
201+
200202
</container>
201203
202204
.. code-block:: php

configuration/using_parameters_in_dic.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,10 @@ Now, examine the results to see this closely:
5656
<my-bundle:config logging="true" />
5757
<!-- true, as expected -->
5858
59-
<my-bundle:config logging="%kernel.debug%" />
60-
<!-- true/false (depends on 2nd parameter of AppKernel),
61-
as expected, because %kernel.debug% inside configuration
62-
gets evaluated before being passed to the extension -->
59+
<my-bundle:config logging="%kernel.debug%" />
60+
<!-- true/false (depends on 2nd parameter of AppKernel),
61+
as expected, because %kernel.debug% inside configuration
62+
gets evaluated before being passed to the extension -->
6363
6464
<my-bundle:config />
6565
<!-- passes the string "%kernel.debug%".

console/commands_as_services.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,15 @@ with ``console.command``:
3939
<container xmlns="http://symfony.com/schema/dic/services"
4040
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4141
xsi:schemaLocation="http://symfony.com/schema/dic/services
42-
http://symfony.com/schema/dic/services/services-1.0.xsd">
42+
http://symfony.com/schema/dic/services/services-1.0.xsd">
4343
4444
<services>
4545
<service id="app.command.my_command"
4646
class="AppBundle\Command\MyCommand">
4747
<tag name="console.command" />
4848
</service>
4949
</services>
50+
5051
</container>
5152
5253
.. code-block:: php
@@ -89,7 +90,7 @@ store the default value in some ``%command.default_name%`` parameter::
8990
public function __construct($defaultName)
9091
{
9192
$this->defaultName = $defaultName;
92-
93+
9394
parent::__construct();
9495
}
9596

@@ -145,7 +146,7 @@ inject the ``command.default_name`` parameter:
145146
<container xmlns="http://symfony.com/schema/dic/services"
146147
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
147148
xsi:schemaLocation="http://symfony.com/schema/dic/services
148-
http://symfony.com/schema/dic/services/services-1.0.xsd">
149+
http://symfony.com/schema/dic/services/services-1.0.xsd">
149150
150151
<parameters>
151152
<parameter key="command.default_name">Javier</parameter>
@@ -158,6 +159,7 @@ inject the ``command.default_name`` parameter:
158159
<tag name="console.command" />
159160
</service>
160161
</services>
162+
161163
</container>
162164
163165
.. code-block:: php

console/logging.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,17 @@ First configure a listener for console exception events in the service container
9292
<!-- app/config/services.xml -->
9393
<?xml version="1.0" encoding="UTF-8" ?>
9494
<container xmlns="http://symfony.com/schema/dic/services"
95-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
96-
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
95+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
96+
xsi:schemaLocation="http://symfony.com/schema/dic/services
97+
http://symfony.com/schema/dic/services/services-1.0.xsd">
9798
9899
<services>
99100
<service id="app.listener.command_exception" class="AppBundle\EventListener\ConsoleExceptionListener">
100101
<argument type="service" id="logger"/>
101102
<tag name="kernel.event_listener" event="console.exception" />
102103
</service>
103104
</services>
105+
104106
</container>
105107
106108
.. code-block:: php
@@ -186,15 +188,17 @@ First configure a listener for console terminate events in the service container
186188
<!-- app/config/services.xml -->
187189
<?xml version="1.0" encoding="UTF-8" ?>
188190
<container xmlns="http://symfony.com/schema/dic/services"
189-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
190-
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">
191+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
192+
xsi:schemaLocation="http://symfony.com/schema/dic/services
193+
http://symfony.com/schema/dic/services/services-1.0.xsd">
191194
192195
<services>
193196
<service id="app.listener.command_error" class="AppBundle\EventListener\ErrorLoggerListener">
194197
<argument type="service" id="logger"/>
195198
<tag name="kernel.event_listener" event="console.terminate" />
196199
</service>
197200
</services>
201+
198202
</container>
199203
200204
.. code-block:: php

console/request_context.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ will override the defaults.
4141
4242
<!-- app/config/parameters.xml -->
4343
<?xml version="1.0" encoding="UTF-8"?>
44-
4544
<container xmlns="http://symfony.com/schema/dic/services"
4645
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
4746
@@ -50,6 +49,7 @@ will override the defaults.
5049
<parameter key="router.request_context.scheme">https</parameter>
5150
<parameter key="router.request_context.base_url">my/path</parameter>
5251
</parameters>
52+
5353
</container>
5454
5555
.. code-block:: php

0 commit comments

Comments
 (0)