e-kevin/yii-dsn-helper

1.1.0 2020-12-16 07:06 UTC

This package is auto-updated.

Last update: 2024-05-04 11:40:25 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;