#1029080: update.inc requires Drupal driver and PDO driver named the same for no reason.

From: Damien Tournoud <damien@commerceguys.com>


---
 includes/update.inc |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/includes/update.inc b/includes/update.inc
index 1eb7a1d..fcb58dc 100644
--- a/includes/update.inc
+++ b/includes/update.inc
@@ -127,8 +127,15 @@ function update_prepare_d7_bootstrap() {
   // the Drupal 7 $databases array themselves but did not do it correctly),
   // this message will be confusing, so do not perform the check; instead, just
   // let the database connection fail in the code that follows.
-  elseif (isset($databases['default']['default']['driver']) && !in_array($databases['default']['default']['driver'], PDO::getAvailableDrivers())) {
-    $message = '<h2>A PDO database driver is required!</h2><p>You need to enable the PDO_' . strtoupper($databases['default']['default']['driver']) . ' database driver for PHP ' . DRUPAL_MINIMUM_PHP . ' or higher so that Drupal 7 can access the database.</p>';
+  elseif (isset($databases['default']['default']['driver'])) {
+    if ($installer = db_installer_object($databases['default']['default']['driver'])) {
+      if (!$installer->hasPdoDriver()) {
+        $message = '<h2>A PDO database driver is required!</h2><p>You need to enable the proper PDO driver for ' . $databases['default']['default']['driver'] . ' for PHP ' . DRUPAL_MINIMUM_PHP . ' or higher so that Drupal 7 can access the database.</p>';
+      }
+    }
+    else {
+      $message = '<h2>Invalid database driver!</h2><p>The ' . $databases['default']['default']['driver'] . ' database driver specified in settings.php is unknown.</p>';
+    }
   }
   if ($message) {
     print $message . '<p>See the <a href="' . $pdo_link . '">system requirements page</a> for more information.</p>';
