/**
* Overrides \Drupal\Core\Database\Connection::createDatabase().
*
* @param string $database
* The name of the database to create.
*
* @throws \Drupal\Core\Database\DatabaseNotFoundException
*/
public function createDatabase($database) { // Escape the database name.
$database = Database::
getConnection()->
escapeDatabase($database);
$db_created = FALSE;
// Try to determine the proper locales for character classification and
// collation. If we could determine locales other than 'en_US', try creating
// the database with these first.
$ctype =
setlocale(LC_CTYPE, 0
);
$collate =
setlocale(LC_COLLATE, 0
);
if ($ctype &&
$collate) { try { $this->connection->
exec("CREATE DATABASE
$database WITH TEMPLATE template0 ENCODING='UTF8' LC_CTYPE='
$ctype.UTF-8' LC_COLLATE='
$collate.UTF-8'"
);
$db_created = TRUE;
}