This isn't quite as powerful as DB::parseDSN(); it's also a lot simpler, a lot faster, and many fewer lines of code.
A array with the following keys will be returned: phptype: Database backend used in PHP (mysql, odbc etc.) protocol: Communication protocol to use (tcp, unix etc.) hostspec: Host specification (hostname[:port]) database: Database to use on the DBMS server username: User name for login password: Password for login
The format of the supplied DSN is in its fullest form:
phptype://username:password/database
Most variations are allowed:
phptype://username:password phptype://username:password/database_name phptype://username:password phptype://username phptype://hostspec/database phptype://hostspec phptype
string | $dsn Data Source Name to be parsed |