Skip to content

Commit cea3fa6

Browse files
committed
Merge branch '2.4' into 2.5
* 2.4: Update voters.rst [Reference] consistent & complete config examples Adding 'attr' option to the Textarea options list Fixed minor typos. document multiple recipients in XML configs Fix documentation for group_sequence_provider Conflicts: reference/constraints/Isbn.rst
2 parents 936cb0f + 924851f commit cea3fa6

Some content is hidden

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

45 files changed

+630
-332
lines changed

book/validation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ provides a sequence of groups to be validated:
11181118
11191119
# src/Acme/DemoBundle/Resources/config/validation.yml
11201120
Acme\DemoBundle\Entity\User:
1121-
group_sequence_provider: ~
1121+
group_sequence_provider: true
11221122
11231123
.. code-block:: php-annotations
11241124

cookbook/logging/monolog_email.rst

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,18 @@ it is broken down.
5858
name="swift"
5959
type="swift_mailer"
6060
from-email="error@example.com"
61-
to-email="error@example.com"
6261
subject="An Error Occurred!"
63-
level="debug"
64-
/>
62+
level="debug">
63+
64+
<monolog:to-email>error@example.com</monolog:to-email>
65+
66+
<!-- or multiple to-email elements -->
67+
<!--
68+
<monolog:to-email>dev1@example.com</monolog:to-email>
69+
<monolog:to-email>dev2@example.com</monolog:to-email>
70+
...
71+
-->
72+
</monolog:handler>
6573
</monolog:config>
6674
</container>
6775

cookbook/security/voters.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ access, not to grant access.
3232
Creating a custom Voter
3333
-----------------------
3434

35-
To blacklist a user based on its IP, you can use the ``request`` service
35+
To blacklist a user based on its IP, you can use the ``request_stack`` service
3636
and compare the IP address against a set of blacklisted IP addresses:
3737

3838
.. code-block:: php

reference/configuration/doctrine.rst

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -359,32 +359,37 @@ The following block shows all possible configuration keys:
359359
360360
.. code-block:: xml
361361
362-
<!-- xmlns:doctrine="http://symfony.com/schema/dic/doctrine" -->
363-
<!-- xsi:schemaLocation="http://symfony.com/schema/dic/doctrine http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd"> -->
364-
365-
<doctrine:config>
366-
<doctrine:dbal
367-
name="default"
368-
dbname="database"
369-
host="localhost"
370-
port="1234"
371-
user="user"
372-
password="secret"
373-
driver="pdo_mysql"
374-
driver-class="MyNamespace\MyDriverImpl"
375-
path="%kernel.data_dir%/data.sqlite"
376-
memory="true"
377-
unix-socket="/tmp/mysql.sock"
378-
wrapper-class="MyDoctrineDbalConnectionWrapper"
379-
charset="UTF8"
380-
logging="%kernel.debug%"
381-
platform-service="MyOwnDatabasePlatformService"
382-
>
383-
<doctrine:option key="foo">bar</doctrine:option>
384-
<doctrine:mapping-type name="enum">string</doctrine:mapping-type>
385-
<doctrine:type name="custom">Acme\HelloBundle\MyCustomType</doctrine:type>
386-
</doctrine:dbal>
387-
</doctrine:config>
362+
<?xml version="1.0" encoding="UTF-8" ?>
363+
<container xmlns="http://symfony.com/schema/dic/services"
364+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
365+
xmlns:doctrine="http://symfony.com/schema/dic/doctrine"
366+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
367+
http://symfony.com/schema/dic/doctrine http://symfony.com/schema/dic/doctrine/doctrine-1.0.xsd">
368+
369+
<doctrine:config>
370+
<doctrine:dbal
371+
name="default"
372+
dbname="database"
373+
host="localhost"
374+
port="1234"
375+
user="user"
376+
password="secret"
377+
driver="pdo_mysql"
378+
driver-class="MyNamespace\MyDriverImpl"
379+
path="%kernel.data_dir%/data.sqlite"
380+
memory="true"
381+
unix-socket="/tmp/mysql.sock"
382+
wrapper-class="MyDoctrineDbalConnectionWrapper"
383+
charset="UTF8"
384+
logging="%kernel.debug%"
385+
platform-service="MyOwnDatabasePlatformService">
386+
387+
<doctrine:option key="foo">bar</doctrine:option>
388+
<doctrine:mapping-type name="enum">string</doctrine:mapping-type>
389+
<doctrine:type name="custom">Acme\HelloBundle\MyCustomType</doctrine:type>
390+
</doctrine:dbal>
391+
</doctrine:config>
392+
</container>
388393
389394
If you want to configure multiple connections in YAML, put them under the
390395
``connections`` key and give them a unique name:

reference/configuration/framework.rst

Lines changed: 45 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -104,21 +104,26 @@ have installed `PhpStormOpener`_ and use PHPstorm, you will do something like:
104104

105105
.. code-block:: yaml
106106
107+
# app/config/config.yml
107108
framework:
108109
ide: "pstorm://%%f:%%l"
109110
110111
.. code-block:: xml
111112
112-
<?xml version="1.0" charset="UTF-8" ?>
113-
<container xmlns="http://symfony.com/schema/dic/service"
114-
xmlns:framework="http://symfony.com/schema/dic/symfony">
113+
<!-- app/config/config.xml -->
114+
<?xml version="1.0" encoding="UTF-8" ?>
115+
<container xmlns="http://symfony.com/schema/dic/services"
116+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
117+
xmlns:framework="http://symfony.com/schema/dic/symfony"
118+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
119+
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
115120
116121
<framework:config ide="pstorm://%%f:%%l" />
117-
118122
</container>
119123
120124
.. code-block:: php
121125
126+
// app/config/config.php
122127
$container->loadFromExtension('framework', array(
123128
'ide' => 'pstorm://%%f:%%l',
124129
));
@@ -158,17 +163,26 @@ see :doc:`/cookbook/request/load_balancer_reverse_proxy`.
158163

159164
.. code-block:: yaml
160165
166+
# app/config/config.yml
161167
framework:
162168
trusted_proxies: [192.0.0.1, 10.0.0.0/8]
163169
164170
.. code-block:: xml
165171
166-
<framework:config trusted-proxies="192.0.0.1, 10.0.0.0/8">
167-
<!-- ... -->
168-
</framework>
172+
<!-- app/config/config.xml -->
173+
<?xml version="1.0" encoding="UTF-8" ?>
174+
<container xmlns="http://symfony.com/schema/dic/services"
175+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
176+
xmlns:framework="http://symfony.com/schema/dic/symfony"
177+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
178+
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
179+
180+
<framework:config trusted-proxies="192.0.0.1, 10.0.0.0/8" />
181+
</container>
169182
170183
.. code-block:: php
171184
185+
// app/config/config.php
172186
$container->loadFromExtension('framework', array(
173187
'trusted_proxies' => array('192.0.0.1', '10.0.0.0/8'),
174188
));
@@ -285,9 +299,17 @@ the value to ``null``:
285299
.. code-block:: xml
286300
287301
<!-- app/config/config.xml -->
288-
<framework:config>
289-
<framework:session save-path="null" />
290-
</framework:config>
302+
<?xml version="1.0" encoding="UTF-8" ?>
303+
<container xmlns="http://symfony.com/schema/dic/services"
304+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
305+
xmlns:framework="http://symfony.com/schema/dic/symfony"
306+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
307+
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
308+
309+
<framework:config>
310+
<framework:session save-path="null" />
311+
</framework:config>
312+
</container>
291313
292314
.. code-block:: php
293315
@@ -373,15 +395,24 @@ Now, activate the ``assets_version`` option:
373395
.. code-block:: xml
374396
375397
<!-- app/config/config.xml -->
376-
<framework:templating assets-version="v2">
377-
<framework:engine id="twig" />
378-
</framework:templating>
398+
<?xml version="1.0" encoding="UTF-8" ?>
399+
<container xmlns="http://symfony.com/schema/dic/services"
400+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
401+
xmlns:framework="http://symfony.com/schema/dic/symfony"
402+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
403+
http://symfony.com/schema/dic/symfony http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
404+
405+
<framework:templating assets-version="v2">
406+
<!-- ... -->
407+
<framework:engine>twig</framework:engine>
408+
</framework:templating>
409+
</container>
379410
380411
.. code-block:: php
381412
382413
// app/config/config.php
383414
$container->loadFromExtension('framework', array(
384-
...,
415+
// ...
385416
'templating' => array(
386417
'engines' => array('twig'),
387418
'assets_version' => 'v2',

reference/configuration/swiftmailer.rst

Lines changed: 29 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -200,29 +200,35 @@ Full default Configuration
200200
201201
.. code-block:: xml
202202
203-
<swiftmailer:config
204-
transport="smtp"
205-
username=""
206-
password=""
207-
host="localhost"
208-
port="false"
209-
encryption=""
210-
auth_mode=""
211-
sender_address=""
212-
delivery_address=""
213-
disable_delivery=""
214-
logging="%kernel.debug%"
215-
>
216-
<swiftmailer:spool
217-
path="%kernel.cache_dir%/swiftmailer/spool"
218-
type="file"
219-
/>
220-
221-
<swiftmailer:antiflood
222-
sleep="0"
223-
threshold="99"
224-
/>
225-
</swiftmailer:config>
203+
<?xml version="1.0" encoding="UTF-8" ?>
204+
<container xmlns="http://symfony.com/schema/dic/services"
205+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
206+
xmlns:swiftmailer="http://symfony.com/schema/dic/swiftmailer"
207+
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd
208+
http://symfony.com/schema/dic/swiftmailer http://symfony.com/schema/dic/swiftmailer/swiftmailer-1.0.xsd">
209+
210+
<swiftmailer:config
211+
transport="smtp"
212+
username=""
213+
password=""
214+
host="localhost"
215+
port="false"
216+
encryption=""
217+
auth_mode=""
218+
sender_address=""
219+
delivery_address=""
220+
disable_delivery=""
221+
logging="%kernel.debug%"
222+
>
223+
<swiftmailer:spool
224+
path="%kernel.cache_dir%/swiftmailer/spool"
225+
type="file" />
226+
227+
<swiftmailer:antiflood
228+
sleep="0"
229+
threshold="99" />
230+
</swiftmailer:config>
231+
</container>
226232
227233
Using multiple Mailers
228234
----------------------

reference/constraints/All.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ entry in that array:
2424

2525
.. code-block:: yaml
2626
27-
# src/UserBundle/Resources/config/validation.yml
27+
# src/Acme/UserBundle/Resources/config/validation.yml
2828
Acme\UserBundle\Entity\User:
2929
properties:
3030
favoriteColors:
@@ -37,15 +37,15 @@ entry in that array:
3737
3838
// src/Acme/UserBundle/Entity/User.php
3939
namespace Acme\UserBundle\Entity;
40-
40+
4141
use Symfony\Component\Validator\Constraints as Assert;
42-
42+
4343
class User
4444
{
4545
/**
4646
* @Assert\All({
4747
* @Assert\NotBlank,
48-
* @Assert\Length(min = "5")
48+
* @Assert\Length(min = 5)
4949
* })
5050
*/
5151
protected $favoriteColors = array();
@@ -77,7 +77,7 @@ entry in that array:
7777
7878
// src/Acme/UserBundle/Entity/User.php
7979
namespace Acme\UserBundle\Entity;
80-
80+
8181
use Symfony\Component\Validator\Mapping\ClassMetadata;
8282
use Symfony\Component\Validator\Constraints as Assert;
8383

reference/constraints/Blank.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ of an ``Author`` class were blank, you could do the following:
2626

2727
.. code-block:: yaml
2828
29-
# src/BlogBundle/Resources/config/validation.yml
29+
# src/Acme/BlogBundle/Resources/config/validation.yml
3030
Acme\BlogBundle\Entity\Author:
3131
properties:
3232
firstName:

reference/constraints/Collection.rst

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ blank but is no longer than 100 characters in length, you would do the following
8585
* @Assert\NotBlank(),
8686
* @Assert\Length(
8787
* max = 100,
88-
* maxMessage = "Your bio is too long!"
88+
* maxMessage = "Your short bio is too long!"
8989
* )
9090
* }
9191
* },
@@ -117,7 +117,7 @@ blank but is no longer than 100 characters in length, you would do the following
117117
<constraint name="NotBlank" />
118118
<constraint name="Length">
119119
<option name="max">100</option>
120-
<option name="maxMessage">Your bio is too long!</option>
120+
<option name="maxMessage">Your short bio is too long!</option>
121121
</constraint>
122122
</value>
123123
</option>
@@ -146,7 +146,10 @@ blank but is no longer than 100 characters in length, you would do the following
146146
'personal_email' => new Assert\Email(),
147147
'lastName' => array(
148148
new Assert\NotBlank(),
149-
new Assert\Length(array("max" => 100)),
149+
new Assert\Length(array(
150+
'max' => 100,
151+
'maxMessage' => 'Your short bio is too long!',
152+
)),
150153
),
151154
),
152155
'allowMissingFields' => true,
@@ -215,13 +218,11 @@ field is optional but must be a valid email if supplied, you can do the followin
215218
* @Assert\Collection(
216219
* fields={
217220
* "personal_email" = @Assert\Required({@Assert\NotBlank, @Assert\Email}),
218-
* "alternate_email" = @Assert\Optional(@Assert\Email),
221+
* "alternate_email" = @Assert\Optional(@Assert\Email)
219222
* }
220223
* )
221224
*/
222-
protected $profileData = array(
223-
'personal_email',
224-
);
225+
protected $profileData = array('personal_email');
225226
}
226227
227228
.. code-block:: xml

reference/constraints/Country.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Basic Usage
2020

2121
.. code-block:: yaml
2222
23-
# src/UserBundle/Resources/config/validation.yml
23+
# src/Acme/UserBundle/Resources/config/validation.yml
2424
Acme\UserBundle\Entity\User:
2525
properties:
2626
country:
@@ -36,7 +36,7 @@ Basic Usage
3636
class User
3737
{
3838
/**
39-
* @Assert\Country
39+
* @Assert\Country()
4040
*/
4141
protected $country;
4242
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy