Re: Converting PEAR DSN to PDO DSN
| From: | Lukas Kahwe Smith | Date: | Thu, 16 Aug 2007 18:52:09 +0000 |
| Subject: | Re: Converting PEAR DSN to PDO DSN | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-47800@lists.php.net to get a copy of this message | ||
Travis Swicegood wrote:
Hey guys,
This seems like a pretty obvious snippet of code, but I couldn't find it in my quick look through PEAR. Is there any code currently in PEAR that takes a PEAR-style DSN and turns it into a PDO-style DSN?
PEAR: mysql://user:pass@host/db
PDO: mysql:host=host;dbname=db
Better yet, is there a database factory object that I'm missing that will let me provide a PEAR-style DSN and get a DB, MDB2, or PDO object back from it? It's simple enough to code something to meet that end, but I don't want to go re-inventing the wheel if I don't have to.
Its really a pitty that PDO devs never implemented portable DSN support. It seems like such a trivial yet convinient thing. So yeah, having a super simple generic loader for DB API's might be nice to have.
regards,
Lukas