8000 Merge branch 'symfony:5.4' into patch-2 · symfony/symfony-docs@a667008 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit a667008

Browse files
authored
Merge branch 'symfony:5.4' into patch-2
2 parents 84f3001 + 2fb6aa9 commit a667008

File tree

216 files changed

+2803
-2429
lines changed

Some content is hidden

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

216 files changed

+2803
-2429
lines changed

.doctor-rst.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ whitelist:
8989
- '.. versionadded:: 1.11' # MakerBundle
9090
- '.. versionadded:: 1.3' # MakerBundle
9191
- '.. versionadded:: 1.8' # MakerBundle
92-
- '.. versionadded:: 1.6' # Flex in setup/upgrade_minor.rst
92+
- '.. versionadded:: 1.18' # Flex in setup/upgrade_minor.rst
9393
- '.. versionadded:: 1.0.0' # Encore
9494
- '0 => 123' # assertion for var_dumper - components/var_dumper.rst
9595
- '1 => "foo"' # assertion for var_dumper - components/var_dumper.rst

.github/CODE_OF_CONDUCT.md

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

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ If your pull request fixes a BUG, use the oldest maintained branch that contains
44
the bug (see https://symfony.com/releases for the list of maintained branches).
55
66
If your pull request documents a NEW FEATURE, use the same Symfony branch where
7-
the feature was introduced (and `5.x` for features of unreleased versions).
7+
the feature was introduced (and `6.x` for features of unreleased versions).
88
99
-->

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ jobs:
118118

119119
- name: Install dependencies
120120
if: ${{ steps.find-files.outputs.files }}
121-
run: composer create-project symfony-tools/code-block-checker _checker
121+
run: composer create-project symfony-tools/code-block-checker:@dev _checker
122122

123123
- name: Install test application
124124
if: ${{ steps.find-files.outputs.files }}

CODE_OF_CONDUCT.md

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

README.markdown

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ We love contributors! For more information on how you can contribute, please rea
2323
the [Symfony Docs Contributing Guide](https://symfony.com/doc/current/contributing/documentation/overview.html)
2424

2525
**Important**: use `4.4` branch as the base of your pull requests, unless you are
26-
documenting a feature that was introduced *after* Symfony 4.4 (e.g. in Symfony 5.2).
26+
documenting a feature that was introduced *after* Symfony 4.4 (e.g. in Symfony 5.4).
2727

2828
Build Documentation Locally
2929---------------------------
@@ -42,4 +42,10 @@ $ composer install
4242
$ php build.php
4343
```
4444

45-
Now you can browse the docs at `_build/output/index.html`
45+
After generating docs, serve them with the internal PHP server:
46+
47+
```bash
48+
$ php -S localhost:8000 -t output/
49+
```
50+
51+
Browse `http://localhost:8000` to read the docs.

_build/build.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@
4646
$result = (new DocBuilder())->build($buildConfig);
4747

4848
if ($result->isSuccessful()) {
49+
// fix assets URLs to make them absolute (otherwise, they don't work in subdirectories)
50+
foreach (glob($outputDir.'/**/*.html') as $htmlFilePath) {
51+
$htmlContents = file_get_contents($htmlFilePath);
52+
file_put_contents($htmlFilePath, str_replace('href="assets/', 'href="/assets/', $htmlContents));
53+
}
54+
4955
$io->success(sprintf("The Symfony Docs were successfully built at %s", realpath($outputDir)));
5056
} else {
5157
$io->error(sprintf("There were some errors while building the docs:\n\n%s\n", $result->getErrorTrace()));

_build/redirection_map

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,6 @@
132132
/cookbook/controller/upload_file /controller/upload_file
133133
/cookbook/debugging /
134134
/debug/debugging /
135-
/cookbook/deployment/azure-website /cookbook/azure-website
136-
/cookbook/deployment/fortrabbit /deployment/fortrabbit
137-
/cookbook/deployment/heroku /deployment/heroku
138-
/cookbook/deployment/index /deployment
139-
/cookbook/deployment/platformsh /deployment/platformsh
140135
/cookbook/deployment/tools /deployment/tools
141136
/cookbook/doctrine/common_extensions /doctrine/common_extensions
142137
/cookbook/doctrine/console /doctrine
@@ -513,9 +508,11 @@
513508
/components/stopwatch https://github.com/symfony/stopwatch
514509
/service_container/3.3-di-changes https://symfony.com/doc/3.4/service_container/3.3-di-changes.html
515510
/frontend/encore/shared-entry /frontend/encore/split-chunks
511+
/frontend/encore/page-specific-assets /frontend/encore/simple-example#page-specific-javascript-or-css
516512
/testing/functional_tests_assertions /testing#testing-application-assertions
517513
/components https://symfony.com/components
518514
/components/index https://symfony.com/components
515+
/serializer/normalizers /components/serializer#normalizers
519516
/logging/monolog_regex_based_excludes /logging/monolog_exclude_http_codes
520517
/security/named_encoders /security/named_hashers
521518
/security/experimental_authenticators /security
@@ -532,3 +529,8 @@
532529
/security/authenticator_manager /security
533530
/security/multiple_guard_authenticators /security/entry_point
534531
/security/guard_authentication /security/custom_authenticator
532+
/components/security/authentication /security#authenticating-users
533+
/components/security/authorization /security#access-control-authorization
534+
/components/security/firewall /security#the-firewall
535+
/components/security/secure_tools /security/passwords
536+
/components/security /security

_build/spelling_word_list.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ filesystem
113113
filesystems
114114
formatter
115115
formatters
116-
fortrabbit
117116
frontend
118117
getter
119118
getters
102 KB
Loading
-1.8 KB
Loading
Loading
Binary file not shown.
Loading
41.8 KB
Loading

_images/profiler/web-interface.png

49.6 KB
Loading

_images/quick_tour/no_routes_page.png

-502 KB
Loading
-58.2 KB
Binary file not shown.

_images/release-process.jpg

-308 KB
Binary file not shown.

_images/security/profiler-badges.png

148 KB
Loading

best_practices.rst

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ to create new Symfony applications:
3030

3131
.. code-block:: terminal
3232
33-
$ symfony new my_project_name
33+
$ symfony new my_project_directory
3434
3535
Under the hood, this Symfony binary command executes the needed `Composer`_
3636
command to :ref:`create a new Symfony application <creating-symfony-applications>`
@@ -269,7 +269,7 @@ Templates
269269
Use Snake Case for Template Names and Variables
270270
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
271271

272-
Use lowercased snake_case for template names, directories and variables (e.g.
272+
Use lowercase snake_case for template names, directories and variables (e.g.
273273
``user_profile`` instead of ``userProfile`` and ``product/edit_form.html.twig``
274274
instead of ``Product/EditForm.html.twig``).
275275

@@ -378,7 +378,8 @@ Use Voters to Implement Fine-grained Security Restrictions
378378

379379
If your security logic is complex, you should create custom
380380
:doc:`security voters </security/voters>` instead of defining long expressions
381-
inside the ``@Security`` annotation.
381+
inside the ``#[Security]`` attribute (or in the ``@Security`` annotation if your
382+
PHP version doesn't support attributes yet).
382383

383384
Web Assets
384385
----------
@@ -387,7 +388,7 @@ Use Webpack Encore to Process Web Assets
387388
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
388389

389390
Web assets are things like CSS, JavaScript and image files that make the
390-
frontend of your site look and work great. `Webpack`_ is the leading JavaScript
391+
frontend of your site looks and works great. `Webpack`_ is the leading JavaScript
391392
module bundler that compiles, transforms and packages assets for usage in a browser.
392393

393394
:doc:`Webpack Encore </frontend>` is a JavaScript library that gets rid of most
@@ -439,7 +440,9 @@ Add this test while creating your application because it requires little effort
439440
and checks that none of your pages returns an error. Later, you'll add more
440441
specific tests for each page.
441442

442-
Hardcode URLs in a Functional Test
443+
.. _hardcode-urls-in-a-functional-test:
444+
445+
Hard-code URLs in a Functional Test
443446
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
444447

445448
In Symfony applications, it's recommended to :ref:`generate URLs <routing-generating-urls>`

bundles/best_practices.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ The ``composer.json`` file should include at least the following metadata:
485485
Consists of the vendor and the short bundle name. If you are releasing the
486486
bundle on your own instead of on behalf of a company, use your personal name
487487
(e.g. ``johnsmith/blog-bundle``). Exclude the vendor name from the bundle
488-
short name and separate each word with an hyphen. For example: AcmeBlogBundle
488+
short name and separate each word with a hyphen. For example: AcmeBlogBundle
489489
is transformed into ``blog-bundle`` and AcmeSocialConnectBundle is
490490
transformed into ``social-connect-bundle``.
491491

bundles/configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ bundle in the console using the Yaml format.
331331

332332
As long as your bundle's configuration is located in the standard location
333333
(``YourBundle\DependencyInjection\Configuration``) and does not have
334-
a constructor it will work automatically. If you
334+
a constructor, it will work automatically. If you
335335
have something different, your ``Extension`` class must override the
336336
:method:`Extension::getConfiguration() <Symfony\\Component\\DependencyInjection\\Extension\\Extension::getConfiguration>`
337337
method and return an instance of your ``Configuration``.

bundles/extension.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ This is how the extension of an AcmeHelloBundle should look like::
3434
namespace Acme\HelloBundle\DependencyInjection;
3535

3636
use Symfony\Component\DependencyInjection\ContainerBuilder;
37-
use Symfony\Component\DependencyInjection\Extension\Extension;
37+
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
3838

3939
class AcmeHelloExtension extends Extension
4040
{

bundles/index.rst

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
:orphan:
2-
31
Bundles
42
=======
53

bundles/prepend_extension.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ How to Simplify Configuration of Multiple Bundles
88
When building reusable and extensible applications, developers are often
99
faced with a choice: either create a single large bundle or multiple smaller
1010
bundles. Creating a single bundle has the drawback that it's impossible for
11-
users to choose to remove functionality they are not using. Creating multiple
11+
users to remove unused functionality. Creating multiple
1212
bundles has the drawback that configuration becomes more tedious and settings
1313
often need to be repeated for various bundles.
1414

cache.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ of:
5050
An adapter is a *template* that you use to create pools.
5151
**Provider**
5252
A provider is a service that some adapters use to connect to the storage.
53-
Redis and Memcached are example of such adapters. If a DSN is used as the
53+
Redis and Memcached are examples of such adapters. If a DSN is used as the
5454
provider then a service is automatically created.
5555

5656
There are two pools that are always enabled by default. They are ``cache.app`` and
@@ -810,5 +810,5 @@ Then, register the ``SodiumMarshaller`` service using this key:
810810

811811
When configuring multiple keys, the first key will be used for reading and
812812
writing, and the additional key(s) will only be used for reading. Once all
813-
cache items encrypted with the old key have expired, you can remove
814-
``OLD_CACHE_DECRYPTION_KEY`` completely.
813+
cache items encrypted with the old key have expired, you can completely remove
814+
``OLD_CACHE_DECRYPTION_KEY``.

components/asset.rst

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ The Asset Component
88
The Asset component manages URL generation and versioning of web assets such
99
as CSS stylesheets, JavaScript files and image files.
1010

11-
In the past, it was common for web applications to hardcode URLs of web assets.
11+
In the past, it was common for web applications to hard-code the URLs of web assets.
1212
For example:
1313

1414
.. code-block:: html
@@ -167,6 +167,26 @@ In those cases, use the
167167
echo $package->getUrl('css/app.css');
168168
// result: build/css/app.b916426ea1d10021f3f17ce8031f93c2.css
169169

170+
If you request an asset that is *not found* in the ``rev-manifest.json`` file,
171+
the original - *unmodified* - asset path will be returned. The ``$strictMode``
172+
argument helps debug issues because it throws an exception when the asset is not
173+
listed in the manifest::
174+
175+
use Symfony\Component\Asset\Package;
176+
use Symfony\Component\Asset\VersionStrategy\JsonManifestVersionStrategy;
177+
178+
// The value of $strictMode can be specific per environment "true" for debugging and "false" for stability.
179+
$strictMode = true;
180+
// assumes the JSON file above is called "rev-manifest.json"
181+
$package = new Package(new JsonManifestVersionStrategy(__DIR__.'/rev-manifest.json', null, $strictMode));
182+
183+
echo $package->getUrl('not-found.css');
184+
// error:
185+
186+
.. versionadded:: 5.4
187+
188+
The ``$strictMode`` option was introduced in Symfony 5.4.
189+
170190
If your JSON file is not on your local filesystem but is accessible over HTTP,
171191
use the :class:`Symfony\\Component\\Asset\\VersionStrategy\\RemoteJsonManifestVersionStrategy`
172192
with the :doc:`HttpClient component </http_client>`::
@@ -375,7 +395,7 @@ they all have different base paths::
375395
$packages = new Packages($defaultPackage, $namedPackages);
376396

377397
The ``Packages`` class allows to define a default package, which will be applied
378-
to assets that don't define the name of package to use. In addition, this
398+
to assets that don't define the name of the package to use. In addition, this
379399
application defines a package named ``img`` to serve images from an external
380400
domain and a ``doc`` package to avoid repeating long paths when linking to a
381401
document inside a template::

components/browser_kit.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ Custom Header Handling
185185
The optional HTTP headers passed to the ``request()`` method follows the FastCGI
186186
request format (uppercase, underscores instead of dashes and prefixed with ``HTTP_``).
187187
Before saving those headers to the request, they are lower-cased, with ``HTTP_``
188-
stripped, and underscores turned to dashes.
188+
stripped, and underscores converted into dashes.
189189

190190
If you're making a request to an application that has special rules about header
191191
capitalization or punctuation, override the ``getHeaders()`` method, which must

components/cache/adapters/couchbasebucket_adapter.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
.. _couchbase-adapter:
66

7-
Couchbase Cache Adapter
8-
=======================
7+
Couchbase Bucket Cache Adapter
8+
==============================
99

1010
.. versionadded:: 5.1
1111

12-
The CouchbaseBucketAdapter was introduced in Symfony 5.1.
12+
The Couchbase Bucket adapter was introduced in Symfony 5.1.
1313

1414
This adapter stores the values in-memory using one (or more) `Couchbase server`_
1515
instances. Unlike the :ref:`APCu adapter <apcu-adapter>`, and similarly to the

components/cache/adapters/couchbasecollection_adapter.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44

55
.. _couchbase-collection-adapter:
66

7-
Couchbase Cache Adapter
8-
=======================
7+
Couchbase Collection Cache Adapter
8+
==================================
99

1010
.. versionadded:: 5.4
1111

12-
The Couchbase Cache Adapter was introduced in Symfony 5.4.
12+
The Couchbase Collection adapter was introduced in Symfony 5.4.
1313

1414
This adapter stores the values in-memory using one (or more) `Couchbase server`_
1515
instances. Unlike the :ref:`APCu adapter <apcu-adapter>`, and similarly to the

0 commit comments

Comments
 (0)
0