b2pweb/bdf-dsn

A dsn parser

v1.0.2 2022-01-31 15:56 UTC

This package is auto-updated.

Last update: 2022-04-29 00:53:34 UTC


README

A simple DSN parser

build Scrutinizer Code Quality Packagist Version Total Downloads

Install via composer

$ composer require b2pweb/bdf-dsn

Usage Instructions

A basic use of DSN.

<?php
$request = \Bdf\Dsn\Dsn::parse('mysql://john:doe@localhost/testdb?timeout=3');

var_dump($request->toArray());

Supports pdo dsn

<?php
$request = \Bdf\Dsn\Dsn::parse('mysql:host=localhost;dbname=testdb;timeout=3');

var_dump($request->toArray());

License

Distributed under the terms of the MIT license.