Via Composer
composer require mikeweb85/dsn
The DSN parser is super simple to use. See the following example:
$dsn = new DSN('mysql://root:[email protected]:3306/test_db/test_table');
$dsn->isValid(); // true
$dsn->getProtocol(); // 'mysql'
$dsn->getUsername(); // 'root'
$dsn->getPassword(); // 'root_pass'
$dsn->getFirstHost(); // '127.0.0.1'
$dsn->getFirstPort(); // 3306
$dsn->getDatabase(); // 'test_db'
$dsn->getTable(); // 'test_table'
$ composer test
The MIT License (MIT). Please see License File for more information.
This project is inpspired by SncRedisBundle and PHP-cache.