Index: install.php
===================================================================
RCS file: /cvs/drupal/drupal/install.php,v
retrieving revision 1.138
diff -u -p -r1.138 install.php
--- install.php	29 Oct 2008 10:08:51 -0000	1.138
+++ install.php	30 Oct 2008 02:32:47 -0000
@@ -179,7 +179,7 @@ function install_verify_settings() {
   global $db_prefix, $databases;
 
   // Verify existing settings (if any).
-  if (!empty($databases)) {
+  if (!empty($databases) && install_verify_pdo()) {
     // We need this because we want to run form_get_errors.
     include_once DRUPAL_ROOT . '/includes/form.inc';
 
@@ -196,6 +196,13 @@ function install_verify_settings() {
 }
 
 /**
+ * Verify PDO library.
+ */
+function install_verify_pdo() {
+  return extension_loaded('pdo');
+}
+
+/**
  * Configure and rewrite settings.php.
  */
 function install_change_settings($profile = 'default', $install_locale = '') {
Index: includes/install.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/install.inc,v
retrieving revision 1.74
diff -u -p -r1.74 install.inc
--- includes/install.inc	24 Oct 2008 18:21:54 -0000	1.74
+++ includes/install.inc	30 Oct 2008 02:32:47 -0000
@@ -205,6 +205,11 @@ function drupal_detect_baseurl($file = '
  */
 function drupal_detect_database_types() {
   $databases = array();
+  
+  // Initialize the database system if it has not been
+  // initialized yet. We do not initialize it earlier to make
+  // requirements check during the installation.
+  require_once DRUPAL_ROOT . '/includes/database/database.inc';  
 
   // We define a driver as a directory in /includes/database that in turn
   // contains a database.inc file.  That allows us to drop in additional drivers
Index: includes/theme.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.inc,v
retrieving revision 1.446
diff -u -p -r1.446 theme.inc
--- includes/theme.inc	26 Oct 2008 18:06:38 -0000	1.446
+++ includes/theme.inc	30 Oct 2008 02:32:48 -0000
@@ -456,7 +456,7 @@ function list_themes($refresh = FALSE) {
     $themes = array();
     // Extract from the database only when it is available.
     // Also check that the site is not in the middle of an install or update.
-    if (db_is_active() && !defined('MAINTENANCE_MODE')) {
+    if (!defined('MAINTENANCE_MODE') && db_is_active()) {
       $result = db_query("SELECT * FROM {system} WHERE type = '%s'", 'theme');
       while ($theme = db_fetch_object($result)) {
         if (file_exists($theme->filename)) {
Index: includes/theme.maintenance.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/theme.maintenance.inc,v
retrieving revision 1.20
diff -u -p -r1.20 theme.maintenance.inc
--- includes/theme.maintenance.inc	26 Oct 2008 18:06:38 -0000	1.20
+++ includes/theme.maintenance.inc	30 Oct 2008 02:32:48 -0000
@@ -28,7 +28,6 @@ function _drupal_maintenance_theme() {
   require_once DRUPAL_ROOT . '/includes/unicode.inc';
   require_once DRUPAL_ROOT . '/includes/file.inc';
   require_once DRUPAL_ROOT . '/includes/module.inc';
-  require_once DRUPAL_ROOT . '/includes/database/database.inc';
   unicode_check();
 
   // Install and update pages are treated differently to prevent theming overrides.
@@ -36,6 +35,7 @@ function _drupal_maintenance_theme() {
     $theme = 'minnelli';
   }
   else {
+    require_once DRUPAL_ROOT . '/includes/database/database.inc';
     // Load module basics (needed for hook invokes).
     $module_list['system']['filename'] = 'modules/system/system.module';
     $module_list['filter']['filename'] = 'modules/filter/filter.module';
Index: modules/system/system.install
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.install,v
retrieving revision 1.272
diff -u -p -r1.272 system.install
--- modules/system/system.install	13 Oct 2008 20:29:42 -0000	1.272
+++ modules/system/system.install	30 Oct 2008 02:32:50 -0000
@@ -93,6 +93,19 @@ function system_requirements($phase) {
     }
   }
 
+  // Test PDO library availablility.
+  $requirements['pdo'] = array(
+    'title' => $t('PDO library'),
+  );
+  if (extension_loaded('pdo')) {
+    $requirements['pdo']['value'] = $t('Enabled');
+  }
+  else {
+    $requirements['pdo']['value'] = $t('Disabled');
+    $requirements['pdo']['severity'] = REQUIREMENT_ERROR;
+    $requirements['pdo']['description'] = $t('Drupal requires the PDO library for database access. See the <a href="@pdo">PHP PDO installation page</a> for instructions on how to enable PDO.', array('@pdo' => 'http://php.net/manual/en/pdo.installation.php'));
+  }
+
   // Test DB version
   global $db_type;
   if (function_exists('db_status_report')) {
@@ -3067,7 +3080,7 @@ function system_update_7011() {
     'permission' => 'bypass node access',
     ));
   }
-  $insert->execute();  
+  $insert->execute();
   return $ret;
 }
 
@@ -3075,4 +3088,3 @@ function system_update_7011() {
  * @} End of "defgroup updates-6.x-to-7.x"
  * The next series of updates should start at 8000.
  */
-
