Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 92adf5f

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: [Config] Suggest avoiding new environments Fix broken link to DoctrineReceiver in Messenger remove reference to not existing YAML dumper flag Update _ux-libraries.rst.inc firewall option replace with allowedHosts Update route from annotation to attribute Use `path` instead of `url` in SSI documentation [Lock] Fix code example for Doctrine based stores
2 parents 270954d + 156972d commit 92adf5f

File tree

8 files changed

+28
-27
lines changed

8 files changed

+28
-27
lines changed

components/lock.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -488,11 +488,11 @@ The DoctrineDbalStore saves locks in an SQL database. It is identical to PdoStor
488488
but requires a `Doctrine DBAL Connection`_, or a `Doctrine DBAL URL`_. This store
489489
does not support blocking, and expects a TTL to avoid stalled locks::
490490

491-
use Symfony\Component\Lock\Store\PdoStore;
491+
use Symfony\Component\Lock\Store\DoctrineDbalStore;
492492

493-
// a PDO, a Doctrine DBAL connection or DSN for lazy connecting through PDO
493+
// a Doctrine DBAL connection or DSN
494494
$connectionOrURL = 'mysql://myuser:[email protected]/app';
495-
$store = new PdoStore($connectionOrURL);
495+
$store = new DoctrineDbalStore($connectionOrURL);
496496

497497
.. note::
498498

@@ -533,11 +533,11 @@ The DoctrineDbalPostgreSqlStore uses `Advisory Locks`_ provided by PostgreSQL.
533533
It is identical to PostgreSqlStore but requires a `Doctrine DBAL Connection`_ or
534534
a `Doctrine DBAL URL`_. It supports native blocking, as well as sharing locks::
535535

536-
use Symfony\Component\Lock\Store\PostgreSqlStore;
536+
use Symfony\Component\Lock\Store\DoctrineDbalPostgreSqlStore;
537537

538-
// a PDO instance or DSN for lazy connecting through PDO
539-
$databaseConnectionOrDSN = 'pgsql:host=localhost;port=5634;dbname=lock';
540-
$store = new PostgreSqlStore($databaseConnectionOrDSN, ['db_username' => 'myuser', 'db_password' => 'mypassword']);
538+
// a Doctrine Connection or DSN
539+
$databaseConnectionOrDSN = 'postgresql+advisory://myuser:[email protected]:5634/lock';
540+
$store = new DoctrineDbalPostgreSqlStore($databaseConnectionOrDSN);
541541

542542
In opposite to the ``DoctrineDbalStore``, the ``DoctrineDbalPostgreSqlStore`` does not need a table to
543543
store locks and does not expire.

components/yaml.rst

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -341,15 +341,14 @@ syntax to parse them as proper PHP constants::
341341
Parsing and Dumping of Binary Data
342342
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
343343

344-
You can dump binary data by using the ``DUMP_BASE64_BINARY_DATA`` flag::
344+
Non UTF-8 encoded strings are dumped as base64 encoded data::
345345

346346
$imageContents = file_get_contents(__DIR__.'/images/logo.png');
347347

348-
$dumped = Yaml::dump(['logo' => $imageContents], 2, 4, Yaml::DUMP_BASE64_BINARY_DATA);
348+
$dumped = Yaml::dump(['logo' => $imageContents]);
349349
// logo: !!binary iVBORw0KGgoAAAANSUhEUgAAA6oAAADqCAY...
350350

351-
Binary data is automatically parsed if they include the ``!!binary`` YAML tag
352-
(there's no need to pass any flag to the Yaml parser)::
351+
Binary data is automatically parsed if they include the ``!!binary`` YAML tag::
353352

354353
$dumped = 'logo: !!binary iVBORw0KGgoAAAANSUhEUgAAA6oAAADqCAY...';
355354
$parsed = Yaml::parse($dumped);

configuration.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,12 @@ going to production:
545545
use `symbolic links`_ between ``config/packages/<environment-name>/``
546546
directories to reuse the same configuration.
547547

548+
Instead of creating new environments, you can use environment variables as
549+
explained in the following section. This way you can use the same application
550+
and environment (e.g. ``prod``) but change its behavior thanks to the
551+
configuration based on environment variables (e.g. to run the application in
552+
different scenarios: staging, quality assurance, client review, etc.)
553+
548554
.. _config-env-vars:
549555

550556
Configuration Based on Environment Variables

frontend/_ux-libraries.rst.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
* `ux-turbo`_: Integration with `Turbo Drive`_ for a single-page-app experience
22
* `ux-live-component`_: Build Dynamic Interfaces with Zero JavaScript
33
* `ux-twig-component`_: Build Twig Components Backed by a PHP Class
4+
* `ux-swup`_: Integration with Swup
45
* `ux-chartjs`_: Easy charts with Chart.js
56
* `ux-lazy-image`_: Optimize Image Loading with BlurHash
67
* `ux-cropperjs`_: Form Type and tools for cropping images
78
* `ux-dropzone`_: Form type for stylized "drop zone" for file uploads
8-
* `ux-swup`_: Integration with Swup
99

1010
.. _`ux-turbo`: https://symfony.com/bundles/ux-turbo/current/index.html
1111
.. _`ux-live-component`: https://symfony.com/bundles/ux-live-component/current/index.html
1212
.. _`ux-twig-component`: https://symfony.com/bundles/ux-twig-component/current/index.html
13+
.. _`ux-swup`: https://symfony.com/bundles/ux-swup/current/index.html
1314
.. _`ux-chartjs`: https://symfony.com/bundles/ux-chartjs/current/index.html
1415
.. _`ux-lazy-image`: https://symfony.com/bundles/ux-lazy-image/current/index.html
1516
.. _`ux-cropperjs`: https://symfony.com/bundles/ux-cropperjs/current/index.html
1617
.. _`ux-dropzone`: https://symfony.com/bundles/ux-dropzone/current/index.html
17-
.. _`ux-swup`: https://symfony.com/bundles/ux-swup/current/index.html
1818
.. _`Turbo Drive`: https://turbo.hotwired.dev/

frontend/encore/virtual-machine.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ Fix "Invalid Host header" Issue
9696
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9797

9898
Webpack will respond ``Invalid Host header`` when trying to access files from
99-
the dev-server. To fix this, set the ``firewall`` option:
99+
the dev-server. To fix this, set the ``allowedHosts`` option:
100100

101101
.. code-block:: javascript
102102
@@ -107,16 +107,16 @@ the dev-server. To fix this, set the ``firewall`` option:
107107
// ...
108108
109109
.configureDevServerOptions(options => {
110-
options.firewall = false;
110+
options.allowedHosts = all;
111111
})
112112
113113
.. caution::
114114

115-
Beware that `it's not recommended to disable the firewall`_ in general, but
115+
Beware that `it's not recommended to set allowedHosts to all`_ in general, but
116116
here it's required to solve the issue when using Encore in a virtual machine.
117117

118118
.. _`VirtualBox`: https://www.virtualbox.org/
119119
.. _`VMWare`: https://www.vmware.com
120120
.. _`NFS`: https://en.wikipedia.org/wiki/Network_File_System
121121
.. _`polling`: https://webpack.js.org/configuration/watch/#watchoptionspoll
122-
.. _`it's not recommended to disable the firewall`: https://webpack.js.org/configuration/dev-server/#devserverdisablehostcheck
122+
.. _`it's not recommended to set allowedHosts to all`: https://webpack.js.org/configuration/dev-server/#devserverallowedhosts

http_cache/ssi.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The SSI instructions are done via HTML comments:
2222
<!-- ... some content -->
2323

2424
<!-- Embed the content of another page here -->
25-
<!--#include virtual="http://..." -->
25+
<!--#include virtual="/..." -->
2626

2727
<!-- ... more content -->
2828
</body>
@@ -121,8 +121,8 @@ The profile index page has not public caching, but the GDPR block has
121121
{# you can use a controller reference #}
122122
{{ render_ssi(controller('App\\Controller\\ProfileController::gdpr')) }}
123123
124-
{# ... or a URL #}
125-
{{ render_ssi(url('profile_gdpr')) }}
124+
{# ... or a path (in server's SSI configuration is common to use relative paths instead of absolute URLs) #}
125+
{{ render_ssi(path('profile_gdpr')) }}
126126
127127
The ``render_ssi`` twig helper will generate something like:
128128

messenger/custom-transport.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ Here is a simplified example of a database transport::
127127
The implementation above is not runnable code but illustrates how a
128128
:class:`Symfony\\Component\\Messenger\\Transport\\TransportInterface` could
129129
be implemented. For real implementations see :class:`Symfony\\Component\\Messenger\\Transport\\InMemoryTransport`
130-
and :class:`Symfony\\Component\\Messenger\\Transport\\Doctrine\\DoctrineReceiver`.
130+
and :class:`Symfony\\Component\\Messenger\\Bridge\\Doctrine\\Transport\\DoctrineReceiver`.
131131

132132
Register your Factory
133133
---------------------

notifier.rst

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,7 @@ To send a notification, autowire the
430430

431431
class InvoiceController extends AbstractController
432432
{
433-
/**
434-
* @Route("/invoice/create")
435-
*/
433+
#[Route('/invoice/create')]
436434
public function create(NotifierInterface $notifier)
437435
{
438436
// ...
@@ -559,9 +557,7 @@ sent using the Slack transport::
559557
// ...
560558
class InvoiceController extends AbstractController
561559
{
562-
/**
563-
* @Route("/invoice/create")
564-
*/
560+
#[Route('/invoice/create')]
565561
public function invoice(NotifierInterface $notifier)
566562
{
567563
// ...

0 commit comments

Comments
 (0)