b2pweb/bdf-dsn
Simple PHP DSN parser for database connection strings. Parse URL-style (mysql://user:pass@host/db?timeout=3) and PDO DSN format (mysql:host=...;dbname=...;timeout=...) into an easy-to-use object/array.
A simple DSN parser
$ composer require b2pweb/bdf-dsn
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());
Distributed under the terms of the MIT license.
How can I help you explore Laravel packages today?