b2pweb/bdf-dsn

A dsn (data source name) parser

v1.0.4 2024-02-26 09:21 UTC

This package is auto-updated.

Last update: 2024-07-26 10:12:53 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.