protected function getDoctrineSettings(array $databaseSettings)
    {
        $databaseMapping = [
            'ezmysqli' => 'pdo_mysql',
            'eZMySQLiDB' => 'pdo_mysql',
            'ezmysql' => 'pdo_mysql',
            'eZMySQLDB' => 'pdo_mysql',
            'ezpostgresql' => 'pdo_pgsql',
            'eZPostgreSQL' => 'pdo_pgsql',
            'postgresql' => 'pdo_pgsql',
            'pgsql' => 'pdo_pgsql',
            'oracle' => 'oci8',
            'ezoracle' => 'oci8',
        ];

        $databaseType = $databaseSettings['DatabaseImplementation'];
        if (isset($databaseMapping[$databaseType])) {
            $databaseType = $databaseMapping[$databaseType];
        }

        $databasePassword = $databaseSettings['Password'] != '' ? $databaseSettings['Password'] : null;
        $doctrineSettings = [
            'driver' => $databaseType,
            'host' => $databaseSettings['Server'],
            'user' => $databaseSettings['User'],
            'password' => $databasePassword,
            'dbname' => $databaseSettings['Database'],
            'charset' => 'UTF8',
        ];
        if (isset($databaseSettings['Port']) && !empty($databaseSettings['Port'])) {
            $doctrineSettings['port'] = $databaseSettings['Port'];
        }
        if (isset($databaseSettings['Socket']) && $databaseSettings['Socket'] !== 'disabled') {
            $doctrineSettings['unix_socket'] = $databaseSettings['Socket'];
        }

        return $doctrineSettings;
    }