Skip to content

Commit 7d27eeb

Browse files
committed
Merge branch '6.4' into 7.0
* 6.4: [HttpClient] Add support for pausing responses [DependencyInjection] Allow loading and dumping tags with an attribute named "name"
2 parents 647a17d + ceb5fd3 commit 7d27eeb

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

http_client.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,6 +1155,10 @@ following methods::
11551155
// returns detailed logs about the requests and responses of the HTTP transaction
11561156
$httpLogs = $response->getInfo('debug');
11571157

1158+
// the special "pause_handler" info item is a callable that allows to delay the request
1159+
// for a given number of seconds; this allows you to delay retries, throttle streams, etc.
1160+
$response->getInfo('pause_handler')(2);
1161+
11581162
.. note::
11591163

11601164
``$response->toStream()`` is part of :class:`Symfony\\Component\\HttpClient\\Response\\StreamableInterface`.

service_container/tags.rst

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,51 @@ To answer this, change the service declaration:
501501

502502
Support for attributes as array was introduced in Symfony 6.2.
503503

504+
.. tip::
505+
506+
The ``name`` attribute is used by default to define the name of the tag.
507+
If you want to add a ``name`` attribute to some tag in XML or YAML formats,
508+
you need to use this special syntax:
509+
510+
.. configuration-block::
511+
512+
.. code-block:: yaml
513+
514+
# config/services.yaml
515+
services:
516+
MailerSmtpTransport:
517+
arguments: ['%mailer_host%']
518+
tags:
519+
# this is a tag called 'app.mail_transport'
520+
- { name: 'app.mail_transport', alias: 'smtp' }
521+
# this is a tag called 'app.mail_transport' with two attributes ('name' and 'alias')
522+
- app.mail_transport: { name: 'arbitrary-value', alias: 'smtp' }
523+
524+
.. code-block:: xml
525+
526+
<!-- config/services.xml -->
527+
<?xml version="1.0" encoding="UTF-8" ?>
528+
<container xmlns="http://symfony.com/schema/dic/services"
529+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
530+
xsi:schemaLocation="http://symfony.com/schema/dic/services
531+
https://symfony.com/schema/dic/services/services-1.0.xsd">
532+
533+
<services>
534+
<service id="MailerSmtpTransport">
535+
<argument>%mailer_host%</argument>
536+
<!-- this is a tag called 'app.mail_transport' -->
537+
<tag name="app.mail_transport" alias="sendmail"/>
538+
<!-- this is a tag called 'app.mail_transport' with two attributes ('name' and 'alias') -->
539+
<tag name="arbitrary-value" alias="smtp">app.mail_transport</tag>
540+
</service>
541+
</services>
542+
</container>
543+
544+
.. versionadded:: 5.1
545+
546+
The possibility to add the ``name`` attribute to a tag in XML and YAML
547+
formats was introduced in Symfony 5.1.
548+
504549
.. tip::
505550

506551
In YAML format, you may provide the tag as a simple string as long as

0 commit comments

Comments
 (0)