File tree 2 files changed +15
-2
lines changed
components/cache/adapters
2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,12 @@ file similar to the following::
33
33
handles file includes, this adapter has the potential to be much faster than other
34
34
filesystem-based caches.
35
35
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
+
36
42
The PhpFilesAdapter can optionally be provided a namespace, default cache lifetime, and cache
37
43
directory path as constructor arguments::
38
44
Original file line number Diff line number Diff line change @@ -49,15 +49,22 @@ message handler. It's a class with an ``__invoke`` method::
49
49
// src/MessageHandler/MyMessageHandler.php
50
50
namespace App\MessageHandler;
51
51
52
- class MyMessageHandler
52
+ use Symfony\Component\Messenger\Handler;
53
+
54
+ class MyMessageHandler implements MessageHandlerInterface
53
55
{
54
56
public function __invoke(MyMessage $message)
55
57
{
56
58
// do something with it.
57
59
}
58
60
}
59
61
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:
61
68
62
69
.. configuration-block ::
63
70
You can’t perform that action at this time.
0 commit comments