We cannot update to the latest version of the dbal 3 because there is a another package conflict. [MAILPOET-6101]
23 lines
497 B
PHP
23 lines
497 B
PHP
<?php declare(strict_types = 1);
|
|
|
|
namespace MailPoet\Config;
|
|
|
|
use MailPoetVendor\Doctrine\DBAL\Connection;
|
|
|
|
class DatabaseInitializer {
|
|
/** @var Connection */
|
|
private $connection;
|
|
|
|
public function __construct(
|
|
Connection $connection
|
|
) {
|
|
$this->connection = $connection;
|
|
}
|
|
|
|
public function initializeConnection() {
|
|
// pass the same PDO connection to legacy Database object
|
|
$database = new Database();
|
|
$database->init($this->connection->getNativeConnection());
|
|
}
|
|
}
|