Create a gist now

Instantly share code, notes, and snippets.

<?php
$connection = require_once __DIR__ . '/../sites/default/dbconnection.php';
Database::addConnectionInfo('default', 'default', $connection);
$container->register('database.default', 'Drupal\Core\Database\Connection')
->setFactoryClass('Drupal\Core\Database\Database')
->setFactoryMethod('getConnection')
->setArguments(array('default', 'default'));
<?php
$connection = array (
'database' => 'sframework',
'username' => 'root',
'password' => 'root',
'host' => 'localhost',
'port' => '',
'namespace' => 'Drupal\\Core\\Database\\Driver\\mysql',
'driver' => 'mysql',
'prefix' => '',
);
return $connection;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment