From b6ce0f85be89200ceb6b21f43e48688852a33b06 Mon Sep 17 00:00:00 2001 From: Chuck Hagenbuch Date: Mon, 5 Jul 2010 16:10:10 -0400 Subject: [PATCH] Use Horde_Db_Adapter_Mysql if the phptype is mysql but PDO_MySQL isn't available. --- framework/Core/lib/Horde/Core/Factory/Db.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/framework/Core/lib/Horde/Core/Factory/Db.php b/framework/Core/lib/Horde/Core/Factory/Db.php index 41fd7af2c..5cf05bced 100644 --- a/framework/Core/lib/Horde/Core/Factory/Db.php +++ b/framework/Core/lib/Horde/Core/Factory/Db.php @@ -121,9 +121,17 @@ class Horde_Core_Factory_Db if ($config['phptype'] == 'oci8') { $config['phptype'] = 'oci'; } - $config['adapter'] = ($config['phptype'] == 'mysqli') - ? 'mysqli' - : 'pdo_' . $config['phptype']; + if ($config['phptype'] == 'mysqli') { + $config['adapter'] = 'mysqli'; + } elseif ($config['phptype'] == 'mysql') { + if (extension_loaded('pdo_mysql')) { + $config['adapter'] = 'pdo_mysql'; + } else { + $config['adapter'] = 'mysql'; + } + } else { + $config['adapter'] = 'pdo_' . $config['phptype']; + } } if (!empty($config['hostspec'])) { -- 2.11.0