I am looking for a way how to convert a PEAR:DB / MDB2-style DSN
phptype://username:password@hostspec/database
into format supported by PHP PDO (such as this mysql case)
$dsn = 'mysql:host=localhost;dbname=testdb';
$username = 'username';
$password = 'password';
I was looking for some existing implementation but couldn’t find anything.
I’ve solved problem with this code, but it’s not yet properly tested: