Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5d5da2f

Browse filesBrowse files
committed
Merge branch '4.1'
* 4.1: Add autoconfiguration note for MessageHandlers PhpFilesAdapter not invalidating cache
2 parents 69cb1d4 + d372739 commit 5d5da2f
Copy full SHA for 5d5da2f

File tree

2 files changed

+15
-2
lines changed
Filter options

2 files changed

+15
-2
lines changed

‎components/cache/adapters/php_files_adapter.rst

Copy file name to clipboardExpand all lines: components/cache/adapters/php_files_adapter.rst
+6Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ file similar to the following::
3333
handles file includes, this adapter has the potential to be much faster than other
3434
filesystem-based caches.
3535

36+
.. caution::
37+
38+
If you have configured OPcache to
39+
:ref:`not check the file timestamps <performance-dont-check-timestamps>`
40+
the cached items will not not be invalidated unless you clear OPcache.
41+
3642
The PhpFilesAdapter can optionally be provided a namespace, default cache lifetime, and cache
3743
directory path as constructor arguments::
3844

‎messenger.rst

Copy file name to clipboardExpand all lines: messenger.rst
+9-2Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,22 @@ message handler. It's a class with an ``__invoke`` method::
4949
// src/MessageHandler/MyMessageHandler.php
5050
namespace App\MessageHandler;
5151

52-
class MyMessageHandler
52+
use Symfony\Component\Messenger\Handler;
53+
54+
class MyMessageHandler implements MessageHandlerInterface
5355
{
5456
public function __invoke(MyMessage $message)
5557
{
5658
// do something with it.
5759
}
5860
}
5961

60-
Once you've created your handler, you need to register it:
62+
Message handlers must be registered as services and :doc:`tagged </service_container/tags>`
63+
with the ``messenger.message_handler`` tag. If you're using the
64+
:ref:`default services.yaml configuration <service-container-services-load-example>`,
65+
this is already done for you, thanks to :ref:`autoconfiguration <services-autoconfigure>`.
66+
67+
If you're not using service autoconfiguration, then you need to add this config:
6168

6269
.. configuration-block::
6370

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.