protected function DatabaseCacheTagsChecksum::ensureTableExists in Drupal 8
Same name and namespace in other branches
- 9 core/lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php \Drupal\Core\Cache\DatabaseCacheTagsChecksum::ensureTableExists()
Check if the cache tags table exists and create it if not.
2 calls to DatabaseCacheTagsChecksum::ensureTableExists()
- DatabaseCacheTagsChecksum::doInvalidateTags in core/
lib/ Drupal/ Core/ Cache/ DatabaseCacheTagsChecksum.php - Marks cache items with any of the specified tags as invalid.
- DatabaseCacheTagsChecksum::getTagInvalidationCounts in core/
lib/ Drupal/ Core/ Cache/ DatabaseCacheTagsChecksum.php - Fetches invalidation counts for cache tags.
File
- core/
lib/ Drupal/ Core/ Cache/ DatabaseCacheTagsChecksum.php, line 75
Class
- DatabaseCacheTagsChecksum
- Cache tags invalidations checksum implementation that uses the database.
Namespace
Drupal\Core\CacheCode
protected function ensureTableExists() {
try {
$database_schema = $this->connection
->schema();
// Create the cache tags table if it does not exist.
if (!$database_schema
->tableExists('cachetags')) {
$schema_definition = $this
->schemaDefinition();
$database_schema
->createTable('cachetags', $schema_definition);
return TRUE;
}
} catch (DatabaseException $e) {
return TRUE;
}
return FALSE;
}