diff --git a/core/lib/Drupal/Core/Cache/ApcuBackend.php b/core/lib/Drupal/Core/Cache/ApcuBackend.php index 00c6aa5..eb500a0 100644 --- a/core/lib/Drupal/Core/Cache/ApcuBackend.php +++ b/core/lib/Drupal/Core/Cache/ApcuBackend.php @@ -137,7 +137,7 @@ public function getMultiple(&$cids, $allow_invalid = FALSE) { * @return \APCIterator * An APCIterator containing matched items. */ - public function getAll($prefix = '') { + protected function getAll($prefix = '') { return new \APCIterator('user', '/^' . preg_quote($this->getApcuKey($prefix), '/') . '/'); } @@ -237,8 +237,6 @@ public function deleteMultiple(array $cids) { */ public function deleteAll() { apc_delete(new \APCIterator('user', '/^' . preg_quote($this->binPrefix, '/') . '/')); - apc_delete(new \APCIterator('user', '/^' . preg_quote($this->deletionsTagsPrefix, '/') . '/')); - apc_delete(new \APCIterator('user', '/^' . preg_quote($this->invalidationsTagsPrefix, '/') . '/')); } /** @@ -253,7 +251,9 @@ public function garbageCollection() { * {@inheritdoc} */ public function removeBin() { - $this->deleteAll(); + apc_delete(new \APCIterator('user', '/^' . preg_quote($this->binPrefix, '/') . '/')); + apc_delete(new \APCIterator('user', '/^' . preg_quote($this->deletionsTagsPrefix, '/') . '/')); + apc_delete(new \APCIterator('user', '/^' . preg_quote($this->invalidationsTagsPrefix, '/') . '/')); } /** diff --git a/core/modules/system/lib/Drupal/system/Tests/Cache/ApcuBackendUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Cache/ApcuBackendUnitTest.php index 4c3907c..cddbfc6 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Cache/ApcuBackendUnitTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Cache/ApcuBackendUnitTest.php @@ -39,6 +39,13 @@ protected function checkRequirements() { } protected function createCacheBackend($bin) { - return new ApcuBackend($bin, $this->databasePrefix); + $this->backend = new ApcuBackend($bin, $this->databasePrefix); + return $this->backend; + } + + public function tearDown() { + $this->backend->removeBin(); + parent::tearDown(); + $this->backend = NULL; } }