Skip to content

Commit 1bfa4cf

Browse files
committed
Merge branch '3.4' into 4.0
* 3.4: Update serializer.rst Tweak wording in Upgrading a Patch Version Reword the explanation about HTTP exceptions added documentation for author tag management be more clear about child form to be themed FIX : accessing global variable tokenStorage Wrong attribute serializer xml fix FormError access in Twig template class attribute still needed in some cases Be consistent how we write "core team" add missing redirection map entry Added a note about using the security checker independently Use the default article title Use "children" property instead of "child" Update web_server_configuration.rst Encore.configureUrlLoader() documentation Updated a Twig example
2 parents 111e996 + 9bbe977 commit 1bfa4cf

File tree

15 files changed

+90
-25
lines changed

15 files changed

+90
-25
lines changed

_build/redirection_map

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@
379379
/reference/configuration/assetic /frontend/assetic
380380
/security/target_path /security
381381
/security/csrf_in_login_form /security/csrf
382+
/service_container/service_locators /service_container/service_subscribers_locators
382383
/service_container/third_party /service_container
383384
/templating/templating_service /templates
384385
/testing/simulating_authentication /testing/http_authentication

components/serializer.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -796,9 +796,8 @@ Here, we set it to 2 for the ``$child`` property:
796796
http://symfony.com/schema/dic/serializer-mapping/serializer-mapping-1.0.xsd"
797797
>
798798
<class name="Acme\MyObj">
799-
<attribute name="foo">
800-
<max-depth>2</max-depth>
801-
</attribute>
799+
<attribute name="foo" max-depth="2" />
800+
</class>
802801
</serializer>
803802
804803
The metadata loader corresponding to the chosen format must be configured in

contributing/code/core_team.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ All the Symfony Core members are long-time contributors with solid technical
99
expertise and they have demonstrated a strong commitment to drive the project
1010
forward.
1111

12-
This document states the rules that govern the Symfony Core team. These rules
12+
This document states the rules that govern the Symfony core team. These rules
1313
are effective upon publication of this document and all Symfony Core members
1414
must adhere to said rules and protocol.
1515

@@ -121,7 +121,7 @@ Active Core Members
121121
Former Core Members
122122
~~~~~~~~~~~~~~~~~~~
123123

124-
They are no longer part of the Core Team, but we are very grateful for all their
124+
They are no longer part of the core team, but we are very grateful for all their
125125
Symfony contributions:
126126

127127
* **Bernhard Schussek** (`webmozart`_);

contributing/code/security.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ Reporting a Security Issue
1111
If you think that you have found a security issue in Symfony, don't use the
1212
bug tracker and don't publish it publicly. Instead, all security issues must
1313
be sent to **security [at] symfony.com**. Emails sent to this address are
14-
forwarded to the Symfony core-team private mailing-list.
14+
forwarded to the Symfony core team private mailing-list.
1515

1616
Resolving Process
1717
-----------------
1818

1919
For each report, we first try to confirm the vulnerability. When it is
20-
confirmed, the core-team works on a solution following these steps:
20+
confirmed, the core team works on a solution following these steps:
2121

2222
#. Send an acknowledgement to the reporter;
2323
#. Work on a patch;

contributing/code/standards.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,12 @@ Documentation
260260
* The ``@package`` and ``@subpackage`` annotations are not used;
261261

262262
* Don't inline PHPDoc blocks, even when they contain just one tag (e.g. don't
263-
put ``/** {@inheritdoc} */`` in a single line).
263+
put ``/** {@inheritdoc} */`` in a single line);
264+
265+
* When adding a new class or when making significant changes to an existing class,
266+
an ``@author`` tag with personal contact information may be added, or expanded.
267+
Please note it is possible to have the personal contact information updated or
268+
removed per request to the doc:`core team </contributing/code/core_team>`.
264269

265270
License
266271
~~~~~~~

controller.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -343,9 +343,12 @@ method is just a shortcut to create a special
343343
:class:`Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException`
344344
object, which ultimately triggers a 404 HTTP response inside Symfony.
345345

346-
Of course, you can throw any ``Exception`` class in your controller: Symfony will
347-
automatically return a 500 HTTP response code::
346+
If you throw an exception that extends or is an instance of
347+
:class:`Symfony\\Component\\HttpKernel\\Exception\\HttpException`, Symfony will
348+
use the appropriate HTTP status code. Otherwise, the response will have a 500
349+
HTTP status code::
348350

351+
// this exception ultimately generates a 500 status error
349352
throw new \Exception('Something went wrong!');
350353

351354
In every case, an error page is shown to the end user and a full debug

form/form_customization.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ You can also apply a form theme to a specific child of your form:
382382

383383
.. code-block:: html+twig
384384

385-
{% form_theme form.child 'form/fields.html.twig' %}
385+
{% form_theme form.a_child_form 'form/fields.html.twig' %}
386386

387387
This is useful when you want to have a custom theme for a nested form that's
388388
different than the one of your main form. Just specify both your themes:
@@ -391,7 +391,7 @@ different than the one of your main form. Just specify both your themes:
391391

392392
{% form_theme form 'form/fields.html.twig' %}
393393

394-
{% form_theme form.child 'form/fields_child.html.twig' %}
394+
{% form_theme form.a_child_form 'form/fields_child.html.twig' %}
395395

396396
Form Theming in PHP
397397
-------------------

frontend.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ Optimizing
5353
* :doc:`Versioning (and the manifest.json file) </frontend/encore/versioning>`
5454
* :doc:`Using A CDN </frontend/encore/cdn>`
5555
* :doc:`Creating a "Shared" entry for re-used modules </frontend/encore/shared-entry>`
56+
* :doc:`/frontend/encore/url-loader`
5657

5758
Guides
5859
......

frontend/encore/url-loader.rst

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
Inlining files in CSS with Webpack URL Loader
2+
=============================================
3+
4+
A simple technique to improve the performance of web applications is to reduce
5+
the number of HTTP requests inlining small files as base64 encoded URLs in the
6+
generated CSS files.
7+
8+
Webpack Encore provides this feature via Webpack's `URL Loader`_ plugin, but
9+
it's disabled by default. First, add the URL loader to your project:
10+
11+
.. code-block:: terminal
12+
13+
$ yarn add --dev url-loader
14+
15+
Then enable it in your ``webpack.config.js``:
16+
17+
.. code-block:: javascript
18+
19+
// webpack.config.js
20+
// ...
21+
22+
Encore
23+
// ...
24+
.configureUrlLoader({
25+
fonts: { limit: 4096 },
26+
images: { limit: 4096 }
27+
})
28+
;
29+
30+
The ``limit`` option defines the maximum size in bytes of the inlined files. In
31+
the previous example, font and image files having a size below or equal to 4 KB
32+
will be inlined and the rest of files will be processed as usual.
33+
34+
You can also use all the other options supported by the `URL Loader`_. If you
35+
want to disable this loader for either images or fonts, remove the corresponding
36+
key from the object that is passed to the ``configureUrlLoader()`` method:
37+
38+
.. code-block:: javascript
39+
40+
// webpack.config.js
41+
// ...
42+
43+
Encore
44+
// ...
45+
.configureUrlLoader({
46+
// 'fonts' is not defined, so only images will be inlined
47+
images: { limit: 4096 }
48+
})
49+
;
50+
51+
.. _`URL loader`: https://github.com/webpack-contrib/url-loader

reference/dic_tags.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1079,7 +1079,7 @@ also have to be added as regular services:
10791079
.. code-block:: yaml
10801080
10811081
services:
1082-
Twig_Extensions_Extension_Intl:
1082+
Twig\Extensions\IntlExtension:
10831083
tags: [twig.extension]
10841084
10851085
.. code-block:: xml
@@ -1091,7 +1091,7 @@ also have to be added as regular services:
10911091
http://symfony.com/schema/dic/services/services-1.0.xsd">
10921092
10931093
<services>
1094-
<service id="Twig_Extensions_Extension_Intl">
1094+
<service id="Twig\Extensions\IntlExtension">
10951095
<tag name="twig.extension" />
10961096
</service>
10971097
</services>
@@ -1100,7 +1100,7 @@ also have to be added as regular services:
11001100
.. code-block:: php
11011101
11021102
$container
1103-
->register('Twig_Extensions_Extension_Intl')
1103+
->register('Twig\Extensions\IntlExtension')
11041104
->addTag('twig.extension')
11051105
;
11061106

security/security_checker.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,11 @@ FriendsOfPHP organization.
3232
any of your dependencies is affected by a known security vulnerability.
3333
Therefore, you can easily integrate it in your build process.
3434

35+
.. tip::
36+
37+
The security checker is also available as an independent console application
38+
and distributed as a PHAR file so you can use it in any PHP application.
39+
Check out the `Security Checker repository`_ for more details.
40+
3541
.. _`security advisories database`: https://github.com/FriendsOfPHP/security-advisories
42+
.. _`Security Checker repository`: https://github.com/sensiolabs/security-checker

session/proxy_examples.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ can intercept the session before it is written::
134134

135135
private function getUser()
136136
{
137-
if (!$token = $tokenStorage->getToken()) {
137+
if (!$token = $this->tokenStorage->getToken()) {
138138
return;
139139
}
140140

setup/upgrade_patch.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ update.
2121
.. tip::
2222

2323
It is recommended to update to a new patch version as soon as possible, as
24-
important bugs and security leaks may be fixed in these new releases.
24+
important bugs and security vulnerabilities may be fixed in these new
25+
releases.
2526

2627
.. include:: /setup/_update_all_packages.rst.inc

setup/web_server_configuration.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ and increase web server performance:
121121
</Directory>
122122
ErrorLog /var/log/apache2/project_error.log
123123
CustomLog /var/log/apache2/project_access.log combined
124-
124+
125125
# optionally set the value of the environment variables used in the application
126126
#SetEnv APP_ENV prod
127127
#SetEnv APP_SECRET <app-secret-id>
@@ -176,7 +176,7 @@ listen on. Each pool can also be run under a different UID and GID:
176176
group = www-data
177177
178178
; use a unix domain socket
179-
listen = /var/run/php7.1-fpm.sock
179+
listen = /var/run/php/php7.1-fpm.sock
180180
181181
; or listen on a TCP socket
182182
listen = 127.0.0.1:9000
@@ -274,7 +274,7 @@ instead:
274274

275275
.. code-block:: apache
276276
277-
FastCgiExternalServer /usr/lib/cgi-bin/php7-fcgi -socket /var/run/php7.1-fpm.sock -pass-header Authorization
277+
FastCgiExternalServer /usr/lib/cgi-bin/php7-fcgi -socket /var/run/php/php7.1-fpm.sock -pass-header Authorization
278278
279279
.. _web-server-nginx:
280280

@@ -295,7 +295,7 @@ The **minimum configuration** to get your application running under Nginx is:
295295
}
296296
297297
location ~ ^/index\.php(/|$) {
298-
fastcgi_pass unix:/var/run/php7.1-fpm.sock;
298+
fastcgi_pass unix:/var/run/php/php7.1-fpm.sock;
299299
fastcgi_split_path_info ^(.+\.php)(/.*)$;
300300
include fastcgi_params;
301301

validation/severity.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,7 @@ so that the severity is added as an additional HTML class:
148148
{%- if errors|length > 0 -%}
149149
<ul>
150150
{%- for error in errors -%}
151-
{% if error.constraint.payload.severity is defined %}
152-
{% set severity = error.constraint.payload.severity %}
153-
{% endif %}
154-
<li{% if severity is defined %} class="{{ severity }}"{% endif %}>{{ error.message }}</li>
151+
<li class="{{ error.cause.constraint.payload.severity ?? '' }}">{{ error.message }}</li>
155152
{%- endfor -%}
156153
</ul>
157154
{%- endif -%}

0 commit comments

Comments
 (0)