You are here

function schema_get_connection_engine_class in Schema 7

Same name and namespace in other branches
  1. 8 schema.module \schema_get_connection_engine_class()

Fetch the schema engine class name for a given database connection.

Parameters

string $connection: A database connection key, defaults to 'default'.

Return value

The schema engine class name if available, otherwise FALSE.

2 calls to schema_get_connection_engine_class()
schema_dbobject in ./schema.module
Fetch a schema engine class instance for a given database connection.
schema_get_connection_options in ./schema.module
Get an array of connection options that are supported by schema inspection.

File

./schema.module, line 133
The Schema module provides functionality built on the Schema API.

Code

function schema_get_connection_engine_class($connection = 'default') {
  if ($info = Database::getConnectionInfo($connection)) {
    $driver = $info['default']['driver'];
    $class_name = 'SchemaDatabaseSchema_' . $driver;
    if (class_exists($class_name)) {
      return $class_name;
    }
  }
  return FALSE;
}