Commits

Arie W. Subagja committed 1eddadf

fix dsn

Comments (0)

Files changed (1)

classes/malam/doctrine/core.php

             define('KTPREFIX', $database['table_prefix']);
 
         $manager = Doctrine_Manager::getInstance();
-        
-        if (isset($database['dsn']))
+
+        if (isset($database['connection']['dsn']))
         {
-            $manager->openConnection($database['dsn']);
+            $p = parse_url($database['connection']['dsn']);
+
+            $dsn = "{$p['scheme']}:///{$p['path']}";
+
+            $manager->openConnection($dsn);
         }
         else
         {
                 $database['connection']['database']
             );
         }
-        
+
         $manager->setAttribute(Doctrine_Core::ATTR_TBLNAME_FORMAT, "{$database['table_prefix']}_%s");
         $manager->setAttribute(Doctrine_Core::ATTR_IDXNAME_FORMAT, "{$database['table_prefix']}%s");