You are here

protected function DatabaseRawBackend::ensureBinExists in Supercache 8

Same name and namespace in other branches
  1. 2.0.x src/Cache/DatabaseRawBackend.php \Drupal\supercache\Cache\DatabaseRawBackend::ensureBinExists()

Check if the cache bin exists and create it if not.

4 calls to DatabaseRawBackend::ensureBinExists()
DatabaseRawBackend::counter in src/Cache/DatabaseRawBackend.php
Add an increment (can be negative) to the stored cache data. Only works for stored numeric data.
DatabaseRawBackend::deleteAll in src/Cache/DatabaseRawBackend.php
Deletes all cache items in a bin.
DatabaseRawBackend::deleteMultiple in src/Cache/DatabaseRawBackend.php
Deletes multiple items from the cache.
DatabaseRawBackend::setMultiple in src/Cache/DatabaseRawBackend.php
Store multiple items in the persistent cache.

File

src/Cache/DatabaseRawBackend.php, line 466
Contains \Drupal\supercache\Cache\DatabaseRawBackend.

Class

DatabaseRawBackend
Defines a default cache implementation.

Namespace

Drupal\supercache\Cache

Code

protected function ensureBinExists() {
  try {
    $database_schema = $this->connection
      ->schema();
    if (!$database_schema
      ->tableExists($this->bin)) {
      $schema_definition = $this
        ->schemaDefinition();
      $database_schema
        ->createTable($this->bin, $schema_definition);
      return TRUE;
    }
  } catch (SchemaObjectExistsException $e) {
    return TRUE;
  }
  return FALSE;
}