If you override PDO with own class and you want to implement alias from php.ini, you have to get it with `get_cfg_var` instead of `ini_get`.
<?php
class PDO extends \PDO
{
public function __construct(string $dsn, ?string $username = null, ?string $password = null, ?array $options = null)
{
if (!str_contains($dsn, ':')) {
$dsn = get_cfg_var('pdo.dsn.' . $dsn);
if (!$dsn) {
throw new PDOException('Argument #1 ($dsn) must be a valid data source name');
}
}
parent::__construct($dsn, $username, $password, $options);
}
}
?>