Index: install.php =================================================================== RCS file: /cvs/drupal/drupal/install.php,v retrieving revision 1.133 diff -u -p -r1.133 install.php --- install.php 20 Sep 2008 20:22:23 -0000 1.133 +++ install.php 1 Oct 2008 00:24:33 -0000 @@ -69,6 +69,11 @@ function install_main() { require_once DRUPAL_ROOT . '/includes/cache.inc'; $conf['cache_inc'] = 'includes/cache.inc'; + // Check for PDO + if (!class_exists('PDO') || !method_exists('PDO', 'query')) { + install_pdo_error(); + } + // 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'; @@ -602,7 +607,6 @@ function install_no_profile_error() { exit; } - /** * Show an error page when Drupal has already been installed. */ @@ -615,6 +619,15 @@ function install_already_done_error() { } /** + * Show an error page when PDO is not available. + */ +function install_pdo_error() { + drupal_set_title(st('PDO unavailable or invalid')); + print theme('install_page', '

' . st('We were unable to find the PDO class that is included in PHP but required for database access. See the PHP PDO installation page for instructions on how to enable PDO to continue with the installation process.', array('@pdo' => 'http://us.php.net/manual/en/pdo.installation.php')) . '

'); + exit; +} + +/** * Tasks performed after the database is initialized. */ function install_tasks($profile, $task) { Index: includes/bootstrap.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v retrieving revision 1.228 diff -u -p -r1.228 bootstrap.inc --- includes/bootstrap.inc 20 Sep 2008 20:22:23 -0000 1.228 +++ includes/bootstrap.inc 1 Oct 2008 00:24:34 -0000 @@ -1017,6 +1017,13 @@ function _drupal_bootstrap($phase) { break; case DRUPAL_BOOTSTRAP_DATABASE: + // Check for PDO + if (!class_exists('PDO') || !method_exists('PDO', 'query')) { + if (!function_exists('install_goto')) { + include_once DRUPAL_ROOT . '/includes/install.inc'; + install_goto('install.php'); + } + } // 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';