geno/wp-content/plugins/mailpoet/lib/Config/DatabaseInitializer.php

26 lines
531 B
PHP
Raw Permalink Normal View History

2024-02-01 17:24:18 +05:30
<?php declare(strict_types = 1);
namespace MailPoet\Config;
if (!defined('ABSPATH')) exit;
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->getWrappedConnection());
}
}