Skip to content

Commit 4243346

Browse files
committed
Merge branch '3.2'
* 3.2: (60 commits) docs: choice constraints reference [#7707] minor tweak Fixed code block under "Custom Messages" [#7744] fix XSD locations Minor XML codes fixes [#7686] tweak the example code [#7663] update the PHP example code Update hostname_pattern.rst Add missing ";" Use HTTP instead of http Fixed indentation in security.rst Be consistent on service name Fix missing / typo fix Fix trusted hosts example regular expressions add reference built in listener for kernel.response event in >=3.1 fixup comment Testing: Fix typo from #6427 Update apache_router.rst Update fortrabbit.rst ...
2 parents e47090e + fa3120e commit 4243346

File tree

88 files changed

+240
-198
lines changed

Some content is hidden

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

88 files changed

+240
-198
lines changed
-12 KB
Loading

_images/security/anonymous_wdt.png

-1.9 KB
Loading
-3.56 KB
Loading

assetic/apply_to_option.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,9 @@ In this case you can specify that the ``coffee`` filter is applied to all
163163
name="coffee"
164164
bin="/usr/bin/coffee"
165165
node="/usr/bin/node"
166-
apply_to="\.coffee$" />
167-
<assetic:node-paths>/usr/lib/node_modules/</assetic:node-path>
166+
apply-to="\.coffee$">
167+
<assetic:node-path>/usr/lib/node_modules/</assetic:node-path>
168+
</assetic:filter>
168169
</assetic:config>
169170
</container>
170171
@@ -174,10 +175,10 @@ In this case you can specify that the ``coffee`` filter is applied to all
174175
$container->loadFromExtension('assetic', array(
175176
'filters' => array(
176177
'coffee' => array(
177-
'bin' => '/usr/bin/coffee',
178-
'node' => '/usr/bin/node',
178+
'bin' => '/usr/bin/coffee',
179+
'node' => '/usr/bin/node',
179180
'node_paths' => array('/usr/lib/node_modules/'),
180-
'apply_to' => '\.coffee$',
181+
'apply_to' => '\.coffee$',
181182
),
182183
),
183184
));

assetic/asset_management.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ configuration under the ``assetic`` section. Read more in the
411411
),
412412
),
413413
),
414-
);
414+
));
415415
416416
After you have defined the named assets, you can reference them in your templates
417417
with the ``@named_asset`` notation:

assetic/jpeg_optimize.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ to ``true``:
113113
<assetic:filter
114114
name="jpegoptim"
115115
bin="path/to/jpegoptim"
116-
strip_all="true" />
116+
strip-all="true" />
117117
</assetic:config>
118118
</container>
119119
@@ -217,7 +217,7 @@ following configuration:
217217
name="jpegoptim"
218218
bin="path/to/jpegoptim" />
219219
<assetic:twig>
220-
<assetic:twig_function
220+
<assetic:function
221221
name="jpegoptim" />
222222
</assetic:twig>
223223
</assetic:config>
@@ -234,7 +234,6 @@ following configuration:
234234
),
235235
'twig' => array(
236236
'functions' => array('jpegoptim'),
237-
),
238237
),
239238
));
240239
@@ -277,7 +276,7 @@ file:
277276
name="jpegoptim"
278277
bin="path/to/jpegoptim" />
279278
<assetic:twig>
280-
<assetic:twig_function
279+
<assetic:function
281280
name="jpegoptim"
282281
output="images/*.jpg" />
283282
</assetic:twig>
@@ -296,7 +295,7 @@ file:
296295
'twig' => array(
297296
'functions' => array(
298297
'jpegoptim' => array(
299-
output => 'images/*.jpg'
298+
'output' => 'images/*.jpg',
300299
),
301300
),
302301
),

assetic/php.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ First, configure a new ``scssphp`` Assetic filter:
9999
http://symfony.com/schema/dic/assetic/assetic-1.0.xsd">
100100
101101
<assetic:config>
102-
<filter name="scssphp" formatter="Leafo\ScssPhp\Formatter\Compressed" />
102+
<assetic:filter name="scssphp" formatter="Leafo\ScssPhp\Formatter\Compressed" />
103103
<!-- ... -->
104104
</assetic:config>
105105
</container>
@@ -172,7 +172,7 @@ First, configure a new ``jsqueeze`` Assetic filter as follows:
172172
http://symfony.com/schema/dic/assetic/assetic-1.0.xsd">
173173
174174
<assetic:config>
175-
<filter name="jsqueeze" />
175+
<assetic:filter name="jsqueeze" />
176176
<!-- ... -->
177177
</assetic:config>
178178
</container>

assetic/uglifyjs.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,11 @@ can configure its location using the ``node`` key:
170170
171171
// app/config/config.php
172172
$container->loadFromExtension('assetic', array(
173-
'node' => '/usr/bin/nodejs',
173+
'node' => '/usr/bin/nodejs',
174174
'uglifyjs2' => array(
175-
// the path to the uglifyjs executable
176-
'bin' => '/usr/local/bin/uglifyjs',
177-
),
175+
// the path to the uglifyjs executable
176+
'bin' => '/usr/local/bin/uglifyjs',
177+
),
178178
));
179179
180180
Minify your Assets

best_practices/security.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@ To enable the security voter in the application, define a new service:
335335
# app/config/services.yml
336336
services:
337337
# ...
338-
post_voter:
338+
app.post_voter:
339339
class: AppBundle\Security\PostVoter
340340
arguments: ['@security.access.decision_manager']
341341
public: false

bundles/configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ bundle configuration would look like:
8181
8282
<!-- app/config/config.xml -->
8383
<?xml version="1.0" ?>
84-
8584
<container xmlns="http://symfony.com/schema/dic/services"
85+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
8686
xmlns:acme-social="http://example.org/schema/dic/acme_social"
8787
xsi:schemaLocation="http://symfony.com/schema/dic/services
8888
http://symfony.com/schema/dic/services/services-1.0.xsd">

bundles/installation.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ of the bundle's configuration:
118118
119119
The output will look like this:
120120

121-
.. code-block:: text
121+
.. code-block:: yaml
122122
123123
assetic:
124124
debug: '%kernel.debug%'

components/console/helpers/progressbar.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ before displaying these messages, you must define your own custom format::
300300
$progressBar->setFormat('custom');
301301

302302
Now, use the ``setMessage()`` method to set the value of the ``%message%``
303-
placeholder before displaying the progress bar:
303+
placeholder before displaying the progress bar::
304304

305305
// ...
306306
$progressBar->setMessage('Start');

components/filesystem.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ endpoint for filesystem operations::
4949
mkdir
5050
~~~~~
5151

52-
:method:`Symfony\\Component\\Filesystem\\Filesystem::mkdir` creates a directory.
52+
:method:`Symfony\\Component\\Filesystem\\Filesystem::mkdir` creates a directory recursively.
5353
On POSIX filesystems, directories are created with a default mode value
5454
`0777`. You can use the second argument to set your own mode::
5555

components/phpunit_bridge.rst

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,24 @@ You can install the component in 2 different ways:
3535

3636
.. include:: /components/require_autoload.rst.inc
3737

38+
If you plan to :ref:`write-assertions-about-deprecations` and use the regular
39+
PHPUnit script (not the modified PHPUnit script provided by Symfony), you have
40+
to register a new `test listener`_ called ``SymfonyTestsListener``:
41+
42+
.. code-block:: xml
43+
44+
<!-- http://phpunit.de/manual/6.0/en/appendixes.configuration.html -->
45+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
46+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.0/phpunit.xsd"
47+
>
48+
49+
<!-- ... -->
50+
51+
<listeners>
52+
<listener class="Symfony\Bridge\PhpUnit\SymfonyTestsListener" />
53+
</listeners>
54+
</phpunit>
55+
3856
Usage
3957
-----
4058

@@ -94,9 +112,9 @@ message, enclosed with ``/``. For example, with:
94112

95113
.. code-block:: xml
96114
97-
<!-- http://phpunit.de/manual/4.1/en/appendixes.configuration.html -->
115+
<!-- http://phpunit.de/manual/6.0/en/appendixes.configuration.html -->
98116
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
99-
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.1/phpunit.xsd"
117+
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/6.0/phpunit.xsd"
100118
>
101119
102120
<!-- ... -->
@@ -147,6 +165,8 @@ completely disable the deprecation helper. This is useful to make use of the
147165
rest of features provided by this component without getting errors or messages
148166
related to deprecations.
149167

168+
.. _write-assertions-about-deprecations:
169+
150170
Write Assertions about Deprecations
151171
-----------------------------------
152172

@@ -411,3 +431,4 @@ If you have installed the bridge through Composer, you can run it by calling e.g
411431
.. _`@-silencing operator`: http://php.net/manual/en/language.operators.errorcontrol.php
412432
.. _`@-silenced`: http://php.net/manual/en/language.operators.errorcontrol.php
413433
.. _`Travis CI`: https://travis-ci.org/
434+
.. _`test listener`: https://phpunit.de/manual/current/en/appendixes.configuration.html#appendixes.configuration.test-listeners

components/routing.rst

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,9 @@ to find a route that fits the given request you can also build a URL from
206206
a certain route::
207207

208208
use Symfony\Component\Routing\Generator\UrlGenerator;
209+
use Symfony\Component\Routing\RequestContext;
210+
use Symfony\Component\Routing\Route;
211+
use Symfony\Component\Routing\RouteCollection;
209212

210213
$routes = new RouteCollection();
211214
$routes->add('show_post', new Route('/show/{slug}'));
@@ -321,7 +324,7 @@ a path to the main route definition and some other settings::
321324
$resource,
322325
array $options = array(),
323326
RequestContext $context = null,
324-
array $defaults = array()
327+
LoggerInterface $logger = null
325328
);
326329

327330
With the ``cache_dir`` option you can enable route caching (if you provide a
@@ -370,9 +373,7 @@ routes with UTF-8 characters:
370373
class DefaultController extends Controller
371374
{
372375
/**
373-
*
374376
* @Route("/category/{name}", name="route1", options={"utf8": true})
375-
*
376377
*/
377378
public function categoryAction()
378379
{
@@ -446,15 +447,13 @@ You can also include UTF-8 strings as routing requirements:
446447
class DefaultController extends Controller
447448
{
448449
/**
449-
*
450-
* @Route(
451-
* "/category/{name}",
452-
* name="route2",
453-
* requirements={"default"="한국어"},
454-
* options={"utf8": true}
455-
* )
456-
*
457-
*/
450+
* @Route(
451+
* "/category/{name}",
452+
* name="route2",
453+
* requirements={"default"="한국어"},
454+
* options={"utf8": true}
455+
* )
456+
*/
458457
public function defaultAction()
459458
{
460459
// ...

components/security/authentication.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ The default authentication manager is an instance of
7171
:class:`Symfony\\Component\\Security\\Core\\Authentication\\AuthenticationProviderManager`::
7272

7373
use Symfony\Component\Security\Core\Authentication\AuthenticationProviderManager;
74+
use Symfony\Component\Security\Core\Exception\AuthenticationException;
7475

7576
// instances of Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface
7677
$providers = array(...);
@@ -229,6 +230,7 @@ own, it just needs to follow these rules:
229230
}
230231

231232
// ...
233+
}
232234
}
233235

234236
Using Password Encoders

components/validator/resources.rst

Lines changed: 12 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -148,12 +148,18 @@ Caching
148148
Using many loaders to load metadata from different places is convenient, but it
149149
can slow down your application because each file needs to be parsed, validated
150150
and converted into a :class:`Symfony\\Component\\Validator\\Mapping\\ClassMetadata`
151-
instance. To solve this problem, you can cache the ``ClassMetadata`` information.
151+
instance.
152152

153-
The Validator component comes with an
154-
:class:`Symfony\\Component\\Validator\\Mapping\\Cache\\ApcCache`
155-
implementation. You can easily create other cachers by creating a class which
156-
implements :class:`Symfony\\Component\\Validator\\Mapping\\Cache\\CacheInterface`.
153+
To solve this problem, call the :method:`Symfony\\Component\\Validator\\ValidatorBuilder::setMetadataCache`
154+
method of the Validator builder and pass your own caching class (which must
155+
implement :class:`Symfony\\Component\\Validator\\Mapping\\Cache\\CacheInterface`)::
156+
157+
use Symfony\Component\Validator\Validation;
158+
159+
$validator = Validation::createValidatorBuilder()
160+
// ... add loaders
161+
->setMetadataCache(new SomeImplementCacheInterface());
162+
->getValidator();
157163

158164
.. note::
159165

@@ -163,18 +169,6 @@ implements :class:`Symfony\\Component\\Validator\\Mapping\\Cache\\CacheInterface
163169
the Validator still needs to merge all metadata of one class from every
164170
loader when it is requested.
165171

166-
Enable the cache calling the
167-
:method:`Symfony\\Component\\Validator\\ValidatorBuilder::setMetadataCache`
168-
method of the Validator builder::
169-
170-
use Symfony\Component\Validator\Validation;
171-
use Symfony\Component\Validator\Mapping\Cache\ApcCache;
172-
173-
$validator = Validation::createValidatorBuilder()
174-
// ... add loaders
175-
->setMetadataCache(new ApcCache('some_apc_prefix'));
176-
->getValidator();
177-
178172
Using a Custom MetadataFactory
179173
------------------------------
180174

@@ -193,7 +187,7 @@ this custom implementation using
193187
use Symfony\Component\Validator\Validation;
194188

195189
$validator = Validation::createValidatorBuilder()
196-
->setMetadataFactory(new CustomMetadataFactory(...));
190+
->setMetadataFactory(new CustomMetadataFactory(...))
197191
->getValidator();
198192

199193
.. caution::

configuration.rst

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -150,14 +150,8 @@ it *also* loads other configuration files via its ``imports`` key:
150150
<?xml version="1.0" encoding="UTF-8" ?>
151151
<container xmlns="http://symfony.com/schema/dic/services"
152152
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
153-
xmlns:framework="http://symfony.com/schema/dic/symfony"
154-
xmlns:twig="http://symfony.com/schema/dic/twig"
155153
xsi:schemaLocation="http://symfony.com/schema/dic/services
156-
http://symfony.com/schema/dic/services/services-1.0.xsd
157-
http://symfony.com/schema/dic/symfony
158-
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd
159-
http://symfony.com/schema/dic/twig
160-
http://symfony.com/schema/dic/twig/twig-1.0.xsd">
154+
http://symfony.com/schema/dic/services/services-1.0.xsd">
161155
162156
<imports>
163157
<import resource="parameters.yml" />
@@ -258,13 +252,10 @@ key:
258252
<container xmlns="http://symfony.com/schema/dic/services"
259253
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
260254
xmlns:framework="http://symfony.com/schema/dic/symfony"
261-
xmlns:twig="http://symfony.com/schema/dic/twig"
262255
xsi:schemaLocation="http://symfony.com/schema/dic/services
263256
http://symfony.com/schema/dic/services/services-1.0.xsd
264257
http://symfony.com/schema/dic/symfony
265-
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd
266-
http://symfony.com/schema/dic/twig
267-
http://symfony.com/schema/dic/twig/twig-1.0.xsd">
258+
http://symfony.com/schema/dic/symfony/symfony-1.0.xsd">
268259
269260
<!-- ... -->
270261
<parameters>
@@ -358,7 +349,7 @@ configure DoctrineBundle and other parts of Symfony:
358349
.. code-block:: php
359350
360351
// app/config/config.php
361-
$configuration->loadFromExtension('doctrine', array(
352+
$container->loadFromExtension('doctrine', array(
362353
'dbal' => array(
363354
'driver' => 'pdo_mysql',
364355
// ...

configuration/environments.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,10 +290,10 @@ The best way to accomplish this is via a new environment called, for example,
290290
.. code-block:: php
291291
292292
// app/config/config_benchmark.php
293-
$loader->import('config_prod.php')
293+
$loader->import('config_prod.php');
294294
295295
$container->loadFromExtension('framework', array(
296-
'profiler' => array('only-exceptions' => false),
296+
'profiler' => array('only_exceptions' => false),
297297
));
298298
299299
.. include:: /components/dependency_injection/_imports-parameters-note.rst.inc

configuration/external_parameters.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ of the following:
104104
105105
.. code-block:: nginx
106106
107-
fastcgi_param DATABASE_USER user
108-
fastcgi_param DATABASE_PASSWORD secret
107+
fastcgi_param DATABASE_USER user;
108+
fastcgi_param DATABASE_PASSWORD secret;
109109
110110
.. code-block:: terminal
111111

0 commit comments

Comments
 (0)