Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. DatabaseBackend.php

function DatabaseBackend::ensureTableExists

Check if the flood table exists and create it if not.

2 calls to DatabaseBackend::ensureTableExists()
DatabaseBackend::isAllowed in core/lib/Drupal/Core/Flood/DatabaseBackend.php
Checks whether a user is allowed to proceed with the specified event.
DatabaseBackend::register in core/lib/Drupal/Core/Flood/DatabaseBackend.php
Registers an event for the current visitor to the flood control mechanism.

File

core/lib/Drupal/Core/Flood/DatabaseBackend.php, line 158

Class

DatabaseBackend
Defines the database flood backend. This is the default Drupal backend.

Namespace

Drupal\Core\Flood

Code

protected function ensureTableExists() {
    try {
        $database_schema = $this->connection
            ->schema();
        $schema_definition = $this->schemaDefinition();
        $database_schema->createTable(static::TABLE_NAME, $schema_definition);
    } catch (DatabaseException) {
    } catch (\Exception) {
        return FALSE;
    }
    return TRUE;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal