You are here

public function Tasks::initializeDatabase in Drupal driver for SQL Server and SQL Azure 4.1.x

Same name and namespace in other branches
  1. 4.2.x src/Driver/Database/sqlsrv/Install/Tasks.php \Drupal\sqlsrv\Driver\Database\sqlsrv\Install\Tasks::initializeDatabase()
  2. 3.1.x src/Driver/Database/sqlsrv/Install/Tasks.php \Drupal\sqlsrv\Driver\Database\sqlsrv\Install\Tasks::initializeDatabase()
  3. 4.0.x src/Driver/Database/sqlsrv/Install/Tasks.php \Drupal\sqlsrv\Driver\Database\sqlsrv\Install\Tasks::initializeDatabase()

Make SQLServer Drupal friendly.

File

src/Driver/Database/sqlsrv/Install/Tasks.php, line 143

Class

Tasks
Specifies installation tasks for PostgreSQL databases.

Namespace

Drupal\sqlsrv\Driver\Database\sqlsrv\Install

Code

public function initializeDatabase() {

  // We create some functions using global names instead of prefixing them
  // like we do with table names. This is so that we don't double up if more
  // than one instance of Drupal is running on a single database. We therefore
  // avoid trying to create them again in that case.
  try {

    /** @var \Drupal\sqlsrv\Driver\Database\sqlsrv\Connection $connection */
    $connection = Database::getConnection();
    Utils::DeployCustomFunctions($connection);
    $this
      ->pass(t('SQLServer has initialized itself.'));
  } catch (\Exception $e) {
    $this
      ->fail(t('Drupal could not be correctly setup with the existing database. Revise any errors.'));
  }
}