diff --git a/core/lib/Drupal/Core/Cache/DatabaseBackend.php b/core/lib/Drupal/Core/Cache/DatabaseBackend.php index 6c78eeb..cde83e6 100644 --- a/core/lib/Drupal/Core/Cache/DatabaseBackend.php +++ b/core/lib/Drupal/Core/Cache/DatabaseBackend.php @@ -230,7 +230,7 @@ class DatabaseBackend implements CacheBackendInterface { ->execute(); } else { - // No minimum cache lifetime, flush all expired and temporary cache + // No minimum cache lifetime. Flush all expired and temporary cache // entries now. db_delete($this->bin) ->condition('expire', CACHE_PERMANENT, '<>') @@ -252,11 +252,12 @@ class DatabaseBackend implements CacheBackendInterface { ->condition('expire', REQUEST_TIME, '<') ->execute(); - // Clear old temporary cache items, 'old' is defined as older than the + // Clear old temporary cache items. 'Old' is defined as older than the // minimum cache lifetime, or 24 hours, whichever is the greatest. $old = max($cache_lifetime, 86400); - // Clear CACHE_TEMPORARY items that are older than the minimum cache lifetime. + // Clear CACHE_TEMPORARY items that are older than the minimum cache + // lifetime. db_delete($this->bin) ->condition('expire', CACHE_TEMPORARY) ->condition('created', REQUEST_TIME - $old, '<') diff --git a/core/modules/system/tests/cache.test b/core/modules/system/tests/cache.test index 6964e40..d0adf64 100644 --- a/core/modules/system/tests/cache.test +++ b/core/modules/system/tests/cache.test @@ -317,7 +317,7 @@ class CacheClearCase extends CacheTestCase { } /** - * Test CACHE_TEMPORARY behaviour. + * Tests CACHE_TEMPORARY behavior. */ function testCacheTemporary() { $cache = cache($this->default_bin); @@ -327,7 +327,7 @@ class CacheClearCase extends CacheTestCase { $this->assertTrue($this->checkCacheExists('test_cid_clear1', $this->default_value)); $this->assertTrue($this->checkCacheExists('test_cid_clear2', $this->default_value)); - // Expire all items in the bin, only the temporary item should be removed. + // Expire all items in the bin. Only the temporary item should be removed. $cache->expire(); $this->assertFalse($this->checkCacheExists('test_cid_clear1', $this->default_value)); $this->assertTrue($this->checkCacheExists('test_cid_clear2', $this->default_value)); @@ -335,7 +335,7 @@ class CacheClearCase extends CacheTestCase { // Set the temporary item again. $cache->set('test_cid_clear1', $this->default_value, CACHE_TEMPORARY); - // Now call the garbageCollection method, neither item should be removed. + // Now call the garbageCollection method. Neither item should be removed. $cache->garbageCollection(); $this->assertTrue($this->checkCacheExists('test_cid_clear1', $this->default_value)); $this->assertTrue($this->checkCacheExists('test_cid_clear2', $this->default_value));