diff --git a/core/lib/Drupal/Core/Cache/CacheCollector.php b/core/lib/Drupal/Core/Cache/CacheCollector.php index 956cd8e..76444ec 100644 --- a/core/lib/Drupal/Core/Cache/CacheCollector.php +++ b/core/lib/Drupal/Core/Cache/CacheCollector.php @@ -8,6 +8,7 @@ namespace Drupal\Core\Cache; use Drupal\Core\Cache\CacheBackendInterface; +use Drupal\Core\Lock\LockBackendInterface; /** * Default implementation for CacheCollectorInterface. @@ -51,7 +52,7 @@ /** * The lock backend that should be used. * - * @var \Drupal\Core\Lock\LockBackendInterface + * @var LockBackendInterface */ protected $lock; @@ -83,10 +84,12 @@ * The cid for the array being cached. * @param \Drupal\Core\Cache\CacheBackendInterface $cache * The cache backend. + * @param \Drupal\Core\Lock\LockBackendInterface $lock + * The lock backend. * @param array $tags * (optional) The tags to specify for the cache item. */ - public function __construct($cid, CacheBackendInterface $cache, \Drupal\Core\Lock\LockBackendInterface $lock, $tags = array()) { + public function __construct($cid, CacheBackendInterface $cache, LockBackendInterface $lock, $tags = array()) { $this->cid = $cid; $this->cache = $cache; $this->tags = $tags; diff --git a/core/lib/Drupal/Core/Cache/CacheCollectorInterface.php b/core/lib/Drupal/Core/Cache/CacheCollectorInterface.php index f54f1d7..cf5fe51 100644 --- a/core/lib/Drupal/Core/Cache/CacheCollectorInterface.php +++ b/core/lib/Drupal/Core/Cache/CacheCollectorInterface.php @@ -30,8 +30,7 @@ * @return mixed * The corresponding cache data. */ - // @todo: This results in a fatal error in PHP <5.3.10. - //public function get($key); + public function get($key); /** * Sets cache data. diff --git a/core/lib/Drupal/Core/KeyValueStore/KeyValueCacheDecorator.php b/core/lib/Drupal/Core/KeyValueStore/KeyValueCacheDecorator.php index 55a5084..c177bed 100644 --- a/core/lib/Drupal/Core/KeyValueStore/KeyValueCacheDecorator.php +++ b/core/lib/Drupal/Core/KeyValueStore/KeyValueCacheDecorator.php @@ -141,4 +141,12 @@ public function set($key, $value) { $this->cache->delete($this->cid); } + /** + * Implements KeyValueStoreInterface::set(). + */ + public function deleteAll() { + $this->keyValueStore->deleteAll(); + $this->cache->delete($this->cid); + } + } diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php index e074ee1..2a98cd2 100644 --- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php +++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php @@ -890,8 +890,8 @@ protected function refreshVariables() { global $conf; cache('bootstrap')->delete('variables'); $conf = variable_initialize(); - drupal_container()->get('config.factory')->reset(); - drupal_container()->get('state')->reset(); + \Drupal::service('config.factory')->reset(); + \Drupal::service('state')->reset(); } /**