You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix for PurgeTagsListener: checking existence of Psr6StoreInterface incorrect
I tried using the PurgeTagsListener but after successfully installing (composer requiring) the toflar/psr6-symfony-http-cache-store package and including the PurgeTagsListener in my AppCache.php I was hitting the Exception from Line 60: 'Cache tag invalidation only works with the toflar/psr6-symfony-http-cache-store package. See "Symfony HttpCache Configuration" in the documentation.'
Solution: Either use 1. "interface_exists(Psr6StoreInterface::class)" or 2. "class_exists(Psr6Store::class)" to successfully check for existence of package. Decided for 1. in this pull request.
Copy file name to clipboardExpand all lines: src/SymfonyCache/PurgeTagsListener.php
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ class PurgeTagsListener extends AccessControlledListener
56
56
*/
57
57
publicfunction__construct(array$options = [])
58
58
{
59
-
if (!class_exists(Psr6StoreInterface::class)) {
59
+
if (!interface_exists(Psr6StoreInterface::class)) {
60
60
thrownew \Exception('Cache tag invalidation only works with the toflar/psr6-symfony-http-cache-store package. See "Symfony HttpCache Configuration" in the documentation.');
0 commit comments