e-kevin/yii-dsn-helper

dsn helpers class

Maintainers

Package info

github.com/e-kevin/yii-dsn-helper

pkg:composer/e-kevin/yii-dsn-helper

Statistics

Installs: 18

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

1.1.0 2020-12-16 07:06 UTC

This package is auto-updated.

Last update: 2026-03-04 15:44:26 UTC


README

parsing dsn connection strings for most databases.

Usage

use ekevin\dsn\Dsn;

// parse dsn
$dsn = Dsn::parse("mysql:host='localhost';dbname='testDb';port=3306");

// build dsn
$dsn = Dsn::build([
    'scheme'   => 'mysql',
    'hostname' => 'localhost',
    'port'     => '3306',
    'dbname'   => 'testDb',
])->dsn;