From 2d682396816500fdad3c1eebc1df003c9b4d3f1f Mon Sep 17 00:00:00 2001 From: Ezku Date: Fri, 28 Mar 2008 16:25:32 +0000 Subject: [PATCH] Fixed sqlite dsn in Doctrine_Manager::parseDsn() --- lib/Doctrine/Manager.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/Manager.php b/lib/Doctrine/Manager.php index 491f2655c..42b205059 100644 --- a/lib/Doctrine/Manager.php +++ b/lib/Doctrine/Manager.php @@ -417,8 +417,12 @@ class Doctrine_Manager extends Doctrine_Configurable implements Countable, Itera public function parseDsn($dsn) { // fix sqlite dsn so that it will parse correctly - $dsn = str_replace("////", "/", $dsn); - $dsn = str_replace("///c:/", "//c:/", $dsn); + if (false !== strpos($dsn, ':///')) { + // replace windows directory separators + $dsn = str_replace("\\", "/", $dsn); + // replace file:/// format with parse_url()-compatible file:// + $dsn = str_replace(":///", "://", $dsn); + } // silence any warnings $parts = @parse_url($dsn);