Index: includes/bootstrap.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v retrieving revision 1.374 diff -u -p -r1.374 bootstrap.inc --- includes/bootstrap.inc 15 Apr 2010 12:01:28 -0000 1.374 +++ includes/bootstrap.inc 22 Apr 2010 23:48:53 -0000 @@ -1955,6 +1955,12 @@ function _drupal_bootstrap_database() { 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 @@ function _drupal_shutdown_function() { } } } + +/** + * 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/database.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/database/database.inc,v retrieving revision 1.117 diff -u -p -r1.117 database.inc --- includes/database/database.inc 15 Apr 2010 11:53:26 -0000 1.117 +++ includes/database/database.inc 22 Apr 2010 23:48:54 -0000 @@ -559,7 +559,7 @@ abstract class DatabaseConnection extend } } catch (PDOException $e) { - _db_check_install_needed(); + _drupal_check_install_needed(); if ($options['throw_exception']) { // Add additional debug information. if ($query instanceof DatabaseStatementInterface) { @@ -1409,7 +1409,7 @@ abstract class Database { 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) { @@ -1534,7 +1534,7 @@ abstract class Database { // 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; } } @@ -2902,18 +2902,3 @@ function db_ignore_slave() { $_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/database/pgsql/database.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/database/pgsql/database.inc,v retrieving revision 1.36 diff -u -p -r1.36 database.inc --- includes/database/pgsql/database.inc 7 Mar 2010 08:03:45 -0000 1.36 +++ includes/database/pgsql/database.inc 22 Apr 2010 23:48:54 -0000 @@ -90,7 +90,7 @@ class DatabaseConnection_pgsql extends D } } catch (PDOException $e) { - _db_check_install_needed(); + _drupal_check_install_needed(); if ($options['throw_exception']) { // Add additional debug information. if ($query instanceof DatabaseStatementInterface) {