b2pweb/bdf-dsn

A dsn (data source name) parser

v1.0.5 2024-10-09 12:37 UTC

This package is auto-updated.

Last update: 2024-12-02 13:36:16 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.