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 27 Sep 2008 06:15:21 -0000 @@ -69,6 +69,9 @@ function install_main() { require_once DRUPAL_ROOT . '/includes/cache.inc'; $conf['cache_inc'] = 'includes/cache.inc'; + // Check for the PDO database class. + install_check_pdo(); + // 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'; @@ -887,6 +890,18 @@ function install_reserved_tasks() { } /** + * Check for the PDO database class and valid methods and end install + * if unavailable or invalid. + */ +function install_check_pdo() { + if (!class_exists('PDO') || !method_exists('PDO', 'query')) { + 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; + } +} + +/** * Check installation requirements and report any errors. */ function install_check_requirements($profile, $verify) {