Index: includes/database/database.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/database/database.inc,v retrieving revision 1.118 diff -u -r1.118 database.inc --- includes/database/database.inc 23 Apr 2010 05:21:19 -0000 1.118 +++ includes/database/database.inc 23 Apr 2010 06:07:12 -0000 @@ -559,7 +559,7 @@ } } catch (PDOException $e) { - _db_check_install_needed(); + _drupal_check_install_needed(); if ($options['throw_exception']) { // Add additional debug information. if ($query instanceof DatabaseStatementInterface) { @@ -1408,7 +1408,7 @@ final public static function parseConnectionInfo() { global $databases; - _db_check_install_needed(); + _drupal_check_install_needed(); $database_info = is_array($databases) ? $databases : array(); foreach ($database_info as $index => $info) { @@ -1533,7 +1533,7 @@ // It is extremely rare that an exception will be generated here other // than when installing. We therefore intercept it and try the installer, // passing on the exception otherwise. - _db_check_install_needed(); + _drupal_check_install_needed(); throw $e; } } @@ -2898,18 +2898,3 @@ $_SESSION['ignore_slave_server'] = REQUEST_TIME + $duration; } } - -/** - * Redirects the user to the installation script. - * - * This will check if Drupal has not been installed yet (i.e., if no $databases - * array has been defined in the settings.php file) and we are not already - * installing. If both are true, the user is redirected to install.php. - */ -function _db_check_install_needed() { - global $databases; - if (empty($databases) && !drupal_installation_attempted()) { - include_once DRUPAL_ROOT . '/includes/install.inc'; - install_goto('install.php'); - } -} Index: includes/bootstrap.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v retrieving revision 1.375 diff -u -r1.375 bootstrap.inc --- includes/bootstrap.inc 23 Apr 2010 05:21:19 -0000 1.375 +++ includes/bootstrap.inc 23 Apr 2010 06:07:12 -0000 @@ -1955,6 +1955,12 @@ header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden'); exit; } + + // Redirect to install.php if PDO is not installed. + if (!extension_loaded('pdo')) { + _drupal_check_install_needed(); + } + // Initialize the database system. Note that the connection // won't be initialized until it is actually requested. require_once DRUPAL_ROOT . '/includes/database/database.inc'; @@ -2733,3 +2739,18 @@ } } } + +/** + * Redirects the user to the installation script. + * + * This will check if Drupal has not been installed yet (i.e., if no $databases + * array has been defined in the settings.php file) and we are not already + * installing. If both are true, the user is redirected to install.php. + */ +function _drupal_check_install_needed() { + global $databases; + if (empty($databases) && !drupal_installation_attempted()) { + include_once DRUPAL_ROOT . '/includes/install.inc'; + install_goto('install.php'); + } +} Index: includes/database/pgsql/database.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/database/pgsql/database.inc,v retrieving revision 1.36 diff -u -r1.36 database.inc --- includes/database/pgsql/database.inc 7 Mar 2010 08:03:45 -0000 1.36 +++ includes/database/pgsql/database.inc 23 Apr 2010 06:07:12 -0000 @@ -90,7 +90,7 @@ } } catch (PDOException $e) { - _db_check_install_needed(); + _drupal_check_install_needed(); if ($options['throw_exception']) { // Add additional debug information. if ($query instanceof DatabaseStatementInterface) {