From: Chuck Hagenbuch Date: Mon, 5 Jul 2010 20:10:10 +0000 (-0400) Subject: Use Horde_Db_Adapter_Mysql if the phptype is mysql but PDO_MySQL isn't available. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=b6ce0f85be89200ceb6b21f43e48688852a33b06;p=horde.git Use Horde_Db_Adapter_Mysql if the phptype is mysql but PDO_MySQL isn't available. --- 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'])) {