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

Breadcrumb

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

function MatcherDumper::ensureTableExists

Checks if the tree table exists and create it if not.

Return value

bool TRUE if the table was created, FALSE otherwise.

1 call to MatcherDumper::ensureTableExists()
MatcherDumper::dump in core/lib/Drupal/Core/Routing/MatcherDumper.php
Dumps a set of routes to the router table in the database.

File

core/lib/Drupal/Core/Routing/MatcherDumper.php, line 180

Class

MatcherDumper
Dumps Route information to a database table.

Namespace

Drupal\Core\Routing

Code

protected function ensureTableExists() {
    try {
        $this->connection
            ->schema()
            ->createTable($this->tableName, $this->schemaDefinition());
    } catch (DatabaseException) {
        // If another process has already created the config table, attempting to
        // recreate it will throw an exception. In this case just catch the
        // exception and do nothing.
    } 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