Skip to content

Commit 9437ff7

Browse files
committed
Merge remote-tracking branch 'upstream/3.3' into 3.3
2 parents 71e4c97 + 0fe340d commit 9437ff7

File tree

17 files changed

+80
-55
lines changed

17 files changed

+80
-55
lines changed

_build/redirection_map

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@
290290
/components/config/introduction /components/config
291291
/components/config/index /components/config
292292
/components/console/helpers/tablehelper /components/console/helpers/table
293+
/components/console/helpers/progresshelper /components/console/helpers/progressbar
293294
/components/console/introduction /components/console
294295
/components/console/index /components/console
295296
/components/debug/class_loader /components/debug

best_practices/templates.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,15 @@ scattered through lots of bundles.
5353

5454
Use lowercased snake_case for directory and template names.
5555

56+
.. best-practice::
57+
58+
Use a prefixed underscore for partial templates in template names.
59+
60+
You often want to reuse template code using the ``include`` function to avoid
61+
redundant code. To determine those partials easily in the filesystem you should
62+
prefix partials and any other template without HTML body or ``extends`` tag
63+
with a single underscore.
64+
5665
Twig Extensions
5766
---------------
5867

bundles.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,4 +181,4 @@ Learn more
181181

182182
bundles/*
183183

184-
_`third-party bundles`: https://github.com/search?q=topic%3Asymfony-bundle&type=Repositories
184+
.. _`third-party bundles`: https://github.com/search?q=topic%3Asymfony-bundle&type=Repositories

components/asset.rst

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,13 @@ any versioning::
6363

6464
$package = new Package(new EmptyVersionStrategy());
6565

66+
// Absolute path
6667
echo $package->getUrl('/image.png');
6768
// result: /image.png
69+
70+
// Relative path
71+
echo $package->getUrl('image.png');
72+
// result: image.png
6873

6974
Packages implement :class:`Symfony\\Component\\Asset\\PackageInterface`,
7075
which defines the following two methods:
@@ -105,8 +110,13 @@ suffix to any asset path::
105110

106111
$package = new Package(new StaticVersionStrategy('v1'));
107112

113+
// Absolute path
108114
echo $package->getUrl('/image.png');
109115
// result: /image.png?v1
116+
117+
// Relative path
118+
echo $package->getUrl('image.png');
119+
// result: image.png?v1
110120

111121
In case you want to modify the version format, pass a sprintf-compatible format
112122
string as the second argument of the ``StaticVersionStrategy`` constructor::
@@ -122,6 +132,9 @@ string as the second argument of the ``StaticVersionStrategy`` constructor::
122132

123133
echo $package->getUrl('/image.png');
124134
// result: /v1/image.png
135+
136+
echo $package->getUrl('image.png');
137+
// result: v1/image.png
125138

126139
Custom Version Strategies
127140
.........................
@@ -168,8 +181,12 @@ that path over and over again::
168181

169182
$package = new PathPackage('/static/images', new StaticVersionStrategy('v1'));
170183

171-
echo $package->getUrl('/logo.png');
184+
echo $package->getUrl('logo.png');
172185
// result: /static/images/logo.png?v1
186+
187+
// Base path is ignored when using absolute paths
188+
echo $package->getUrl('/logo.png');
189+
// result: /logo.png?v1
173190

174191
Request Context Aware Assets
175192
............................

components/browser_kit.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,4 +233,4 @@ Learn more
233233
* :doc:`/components/dom_crawler`
234234

235235
.. _`Packagist`: https://packagist.org/packages/symfony/browser-kit
236-
.. _`Goutte`: https://github.com/fabpot/Goutte
236+
.. _`Goutte`: https://github.com/FriendsOfPHP/Goutte

components/console/helpers/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ The Console Helpers
1111
formatterhelper
1212
processhelper
1313
progressbar
14-
progresshelper
1514
questionhelper
1615
table
1716
debug_formatter

components/console/helpers/progresshelper.rst

Lines changed: 0 additions & 12 deletions
This file was deleted.

components/serializer.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,8 @@ the middle. This way, Encoders will only deal with turning specific
2121
**formats** into **arrays** and vice versa. The same way, Normalizers
2222
will deal with turning specific **objects** into **arrays** and vice versa.
2323

24-
Serialization is a complicated topic, and while this component may not work
25-
in all cases, it can be a useful tool while developing tools to serialize
26-
and deserialize your objects.
24+
Serialization is a complex topic. This component may not cover all your use cases out of the box,
25+
but it can be useful for developing tools to serialize and deserialize your objects.
2726

2827
Installation
2928
------------

contributing/code/standards.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,9 +190,10 @@ Naming Conventions
190190

191191
* Use namespaces for all classes;
192192

193-
* Prefix abstract classes with ``Abstract``. Please note some early Symfony classes
194-
do not follow this convention and have not been renamed for backward compatibility
195-
reasons. However all new abstract classes must follow this naming convention;
193+
* Prefix all abstract classes with ``Abstract`` except PHPUnit ``*TestCase``.
194+
Please note some early Symfony classes do not follow this convention and
195+
have not been renamed for backward compatibility reasons. However all new
196+
abstract classes must follow this naming convention;
196197

197198
* Suffix interfaces with ``Interface``;
198199

doctrine/event_listeners_subscribers.rst

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
single: Doctrine; Event listeners and subscribers
33

44
.. _doctrine-event-config:
5+
.. _how-to-register-event-listeners-and-subscribers:
56

6-
How to Register Event Listeners and Subscribers
7-
===============================================
7+
Doctrine Event Listeners and Subscribers
8+
========================================
89

910
Doctrine packages have a rich event system that fires events when almost anything
1011
happens inside the system. For you, this means that you can create arbitrary
@@ -188,15 +189,15 @@ For a full reference, see chapter `The Event System`_ in the Doctrine documentat
188189
Lazy loading for Event Listeners
189190
--------------------------------
190191

191-
One subtle difference between listeners and subscribers is that Symfony can load
192+
One subtle difference between listeners and subscribers is that Symfony can load
192193
entity listeners lazily. This means that your listener class will only be fetched
193194
from the service container (and thus be instantiated) once the event it is linked
194195
to actually fires.
195196

196-
Lazy loading might give you a slight performance improvement when your listener
197-
runs for events that rarely fire. Also, it can help you when you run into
197+
Lazy loading might give you a slight performance improvement when your listener
198+
runs for events that rarely fire. Also, it can help you when you run into
198199
*circular dependency issues* that may occur when your listener service in turn
199-
depends on the DBAL connection.
200+
depends on the DBAL connection.
200201

201202
To mark a listener service as lazily loaded, just add the ``lazy`` attribute
202203
to the tag like so:

event_dispatcher.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ During the execution of a Symfony application, lots of event notifications are
99
triggered. Your application can listen to these notifications and respond to
1010
them by executing any piece of code.
1111

12-
Internal events provided by Symfony itself are defined in the
13-
:class:`Symfony\\Component\\HttpKernel\\KernelEvents` class. Third-party bundles
14-
and libraries also trigger lots of events and your own application can trigger
15-
:doc:`custom events </components/event_dispatcher>`.
12+
Symfony triggers several :doc:`events related to the kernel </reference/events>`
13+
while processing the HTTP Request. Third-party bundles may also dispatch events, and
14+
you can even dispatch :doc:`custom events </components/event_dispatcher>` from your
15+
own code.
1616

1717
All the examples shown in this article use the same ``KernelEvents::EXCEPTION``
1818
event for consistency purposes. In your own application, you can use any event

reference/configuration/doctrine.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ Full Default Configuration
2222
some_custom_type:
2323
class: Acme\HelloBundle\MyCustomType
2424
commented: true
25-
# If defined, all the tables whose names match this regular expression are ignored
26-
# by the schema tool (in this example, any table name starting with `wp_`)
27-
#schema_filter: '/^(?!wp_)/'
25+
2826
2927
connections:
3028
# A collection of different named connections (e.g. default, conn2, etc)
@@ -77,6 +75,11 @@ Full Default Configuration
7775
mapping_types:
7876
# an array of mapping types
7977
name: []
78+
79+
# If defined, only the tables whose names match this regular expression are managed
80+
# by the schema tool (in this example, any table name not starting with `wp_`)
81+
#schema_filter: '/^(?!wp_)/'
82+
8083
slaves:
8184
8285
# a collection of named slave connections (e.g. slave1, slave2)

security/acl_advanced.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ After invocation providers also allow to modify, or filter the domain object
174174
before it is returned.
175175

176176
Due to current limitations of the PHP language, there are no
177-
post-authorization capabilities build into the core Security component.
177+
post-authorization capabilities built into the core Security component.
178178
However, there is an experimental JMSSecurityExtraBundle_ which adds these
179179
capabilities. See its documentation for further information on how this is
180180
accomplished.

security/form_login.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ several ways.
3434
Changing the default Page
3535
~~~~~~~~~~~~~~~~~~~~~~~~~
3636

37-
Define the ``default_security_target`` option to change the page where the user
37+
Define the ``default_target_path`` option to change the page where the user
3838
is redirected to if no previous page was stored in the session. The value can be
3939
a relative/absolute URL or a Symfony route name:
4040

security/guard_authentication.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ and add the following logic::
488488

489489
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
490490
use Symfony\Component\Security\Csrf\CsrfToken;
491-
use Symfony\Component\Security\Core\Exception\InvalidCsrfTokenExceptionl
491+
use Symfony\Component\Security\Core\Exception\InvalidCsrfTokenException;
492492

493493
class ExampleFormAuthenticator extends AbstractFormLoginAuthenticator
494494
{

service_container/autowiring.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
Defining Services Dependencies Automatically (Autowiring)
55
=========================================================
66

7-
Autowiring allows you to manage services in the container with minimal configuration.
8-
It reads the type-hints on your constructor (or other methods) and automatically
9-
passes you the correct services. Symfony's autowiring is designed to be predictable:
10-
if it is not absolutely clear which dependency should be passed, you'll see an
11-
actionable exception.
7+
Autowiring allows you to manage services in the container with minimal
8+
configuration. It reads the type-hints on your constructor (or other methods)
9+
and automatically passes the correct services to each method. Symfony's
10+
autowiring is designed to be predictable: if it is not absolutely clear which
11+
dependency should be passed, you'll see an actionable exception.
1212

1313
.. tip::
1414

testing/bootstrap.rst

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,40 +6,47 @@ running those tests. For example, if you're running a functional test and
66
have introduced a new translation resource, then you will need to clear your
77
cache before running those tests.
88

9-
To do this, first add the following file::
9+
To do this, first add a file that executes your bootstrap work::
1010

11-
// app/tests.bootstrap.php
11+
// tests/bootstrap.php
1212
if (isset($_ENV['BOOTSTRAP_CLEAR_CACHE_ENV'])) {
13+
// executes the "php bin/console cache:clear" command
1314
passthru(sprintf(
14-
'php "%s/console" cache:clear --env=%s --no-warmup',
15+
'php "%s/../bin/console" cache:clear --env=%s --no-warmup',
1516
__DIR__,
1617
$_ENV['BOOTSTRAP_CLEAR_CACHE_ENV']
1718
));
1819
}
1920

20-
require __DIR__.'/autoload.php';
21+
require __DIR__.'/../vendor/autoload.php';
2122

22-
Replace the test bootstrap file ``autoload.php`` in ``phpunit.xml.dist``
23-
with ``tests.bootstrap.php``:
23+
Then, configure ``phpunit.xml.dist`` to execute this ``bootstra.php`` file
24+
before running the tests:
2425

2526
.. code-block:: xml
2627
2728
<!-- phpunit.xml.dist -->
28-
29-
<!-- ... -->
29+
<?xml version="1.0" encoding="UTF-8"?>
3030
<phpunit
31-
bootstrap = "tests.bootstrap.php"
31+
bootstrap="tests/bootstrap.php"
3232
>
33+
<!-- ... -->
34+
</phpunit>
3335
3436
Now, you can define in your ``phpunit.xml.dist`` file which environment you want the
3537
cache to be cleared:
3638

3739
.. code-block:: xml
3840
3941
<!-- phpunit.xml.dist -->
40-
<php>
41-
<env name="BOOTSTRAP_CLEAR_CACHE_ENV" value="test"/>
42-
</php>
42+
<?xml version="1.0" encoding="UTF-8"?>
43+
<phpunit>
44+
<!-- ... -->
45+
46+
<php>
47+
<env name="BOOTSTRAP_CLEAR_CACHE_ENV" value="test" />
48+
</php>
49+
</phpunit>
4350
4451
This now becomes an environment variable (i.e. ``$_ENV``) that's available
4552
in the custom bootstrap file (``tests.bootstrap.php``).

0 commit comments

Comments
 (0)