Commit 93057f3c authored by yched's avatar yched Committed by Luca Lusso
Browse files

Issue #2841382 by yched, lussoluca: Webprofiler breaks cache tag invalidation on non-db backends

parent 5d768ef3
......@@ -4,12 +4,13 @@ namespace Drupal\webprofiler\Cache;
use Drupal\Core\Cache\Cache;
use Drupal\Core\Cache\CacheBackendInterface;
use Drupal\Core\Cache\CacheTagsInvalidatorInterface;
use Drupal\webprofiler\DataCollector\CacheDataCollector;
/**
* Wraps an existing cache backend to track calls to the cache backend.
*/
class CacheBackendWrapper implements CacheBackendInterface {
class CacheBackendWrapper implements CacheBackendInterface, CacheTagsInvalidatorInterface {
/**
* The data collector to register the calls.
......@@ -121,13 +122,6 @@ class CacheBackendWrapper implements CacheBackendInterface {
return $this->cacheBackend->deleteMultiple($cids);
}
/**
* {@inheritdoc}
*/
public function deleteTags(array $tags) {
return $this->cacheBackend->deleteTags($tags);
}
/**
* {@inheritdoc}
*/
......@@ -153,7 +147,9 @@ class CacheBackendWrapper implements CacheBackendInterface {
* {@inheritdoc}
*/
public function invalidateTags(array $tags) {
return $this->cacheBackend->invalidateTags($tags);
if ($this->cacheBackend instanceof CacheTagsInvalidatorInterface) {
$this->cacheBackend->invalidateTags($tags);
}
}
/**
......@@ -176,4 +172,5 @@ class CacheBackendWrapper implements CacheBackendInterface {
public function removeBin() {
return $this->cacheBackend->removeBin();
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment