From 9115f57f8f3da190a9f9f05b0db55135f51ac4d7 Mon Sep 17 00:00:00 2001 From: "Michael J. Rubinsky" Date: Wed, 4 Feb 2009 16:39:51 -0500 Subject: [PATCH] Translate these config parameters from rails to pdo style. Bug: 7948 --- framework/Db/lib/Horde/Db/Adapter/Mysqli.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/framework/Db/lib/Horde/Db/Adapter/Mysqli.php b/framework/Db/lib/Horde/Db/Adapter/Mysqli.php index efb1c7f2a..77cc9d5a1 100644 --- a/framework/Db/lib/Horde/Db/Adapter/Mysqli.php +++ b/framework/Db/lib/Horde/Db/Adapter/Mysqli.php @@ -386,7 +386,13 @@ class Horde_Db_Adapter_Mysqli extends Horde_Db_Adapter_Abstract $msg = 'Required config missing: ' . implode(', ', array_keys($diff)); throw new Horde_Db_Exception($msg); } - + $rails2pdo = array('database' => 'dbname', 'socket' => 'unix_socket'); + foreach ($rails2pdo as $from => $to) { + if (isset($this->_config[$from])) { + $this->_config[$to] = $this->_config[$from]; + unset($this->_config[$from]); + } + } if (isset($this->_config['port'])) { if (empty($this->_config['host'])) { $msg = 'host is required if port is specified'; -- 2.11.0