Index: includes/theme.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/theme.inc,v retrieving revision 1.437 diff -u -r1.437 theme.inc --- includes/theme.inc 20 Sep 2008 20:22:23 -0000 1.437 +++ includes/theme.inc 1 Oct 2008 03:30:10 -0000 @@ -435,7 +435,7 @@ $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.19 diff -u -r1.19 theme.maintenance.inc --- includes/theme.maintenance.inc 1 Oct 2008 00:27:29 -0000 1.19 +++ includes/theme.maintenance.inc 1 Oct 2008 03:30:11 -0000 @@ -28,7 +28,6 @@ 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. Index: includes/bootstrap.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v retrieving revision 1.228 diff -u -r1.228 bootstrap.inc --- includes/bootstrap.inc 20 Sep 2008 20:22:23 -0000 1.228 +++ includes/bootstrap.inc 1 Oct 2008 03:29:59 -0000 @@ -363,6 +363,12 @@ } } + // If the $databases configuration array has not been populated, then + // an installation is required. + if (empty($databases)) { + _drupal_install_required(); + } + if ($cookie_domain) { // If the user specifies the cookie domain, also use it for session name. $session_name = $cookie_domain; @@ -1084,6 +1090,15 @@ } /** + * Send the user to the installer page. + */ +function _drupal_install_required() { + if (!function_exists('install_goto')) { + include_once DRUPAL_ROOT . '/includes/install.inc'; + install_goto('install.php'); + } +} +/** * Enables use of the theme system without requiring database access. * * Loads and initializes the theme system for site installs, updates and when Index: includes/database/database.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/database/database.inc,v retrieving revision 1.10 diff -u -r1.10 database.inc --- includes/database/database.inc 28 Sep 2008 21:52:08 -0000 1.10 +++ includes/database/database.inc 1 Oct 2008 03:30:20 -0000 @@ -353,7 +353,7 @@ } catch (PDOException $e) { if (!function_exists('module_implements')) { - _db_need_install(); + _drupal_install_required(); } if ($options['throw_exception']) { if ($query instanceof DatabaseStatement) { @@ -754,9 +754,6 @@ final protected static function parseConnectionInfo() { global $databases; - if (empty($databases)) { - _db_need_install(); - } $databaseInfo = $databases; // If no database key is specified, default to default. @@ -875,7 +872,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_need_install(); + _drupal_install_required(); throw $e; } } @@ -1861,13 +1858,6 @@ return $statement->fetchField(); } -function _db_need_install() { - if (!function_exists('install_goto')) { - include_once DRUPAL_ROOT . '/includes/install.inc'; - install_goto('install.php'); - } -} - /** * Backward-compatibility utility. * Index: install.php =================================================================== RCS file: /cvs/drupal/drupal/install.php,v retrieving revision 1.134 diff -u -r1.134 install.php --- install.php 1 Oct 2008 00:27:29 -0000 1.134 +++ install.php 1 Oct 2008 03:29:51 -0000 @@ -896,7 +896,23 @@ function install_check_requirements($profile, $verify) { // Check the profile requirements. $requirements = drupal_check_profile($profile); - + + // Check if the PDO library is available. + if (class_exists('PDO') && method_exists('PDO', 'query') && class_exists('PDOStatement') && class_exists('PDOException')) { + $requirements['pdo'] = array( + 'title' => st('PDO database API'), + 'value' => st('PDO extension enabled.'), + ); + } + else { + $requirements['pdo'] = array( + 'title' => st('PDO database API'), + 'value' => st('PDO extension not enabled.'), + 'severity' => REQUIREMENT_ERROR, + 'description' => st('We were unable to find the PDO libray required by the databse API. 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')), + ); + } + // If Drupal is not set up already, we need to create a settings file. if (!$verify) { $writable = FALSE; Index: includes/database/pgsql/database.inc =================================================================== RCS file: /cvs/drupal/drupal/includes/database/pgsql/database.inc,v retrieving revision 1.3 diff -u -r1.3 database.inc --- includes/database/pgsql/database.inc 15 Sep 2008 20:48:07 -0000 1.3 +++ includes/database/pgsql/database.inc 1 Oct 2008 03:30:23 -0000 @@ -59,7 +59,7 @@ } catch (PDOException $e) { if (!function_exists('module_implements')) { - _db_need_install(); + _drupal_install_required(); } //watchdog('database', var_export($e, TRUE) . $e->getMessage(), NULL, WATCHDOG_ERROR); if ($options['throw_exception']) {