summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-05-21 11:53:26 +0000
committerDries Buytaert <dries@buytaert.net>2010-05-21 11:53:26 +0000
commit9537ac63aacbeb05b45f2bac908bd1f04e79de2f (patch)
tree855a7380866d1a5578e7f0323f85cfbc1acbfeb7
parent810a59576d7bd001000dab4842cf83bac210e522 (diff)
downloadbrdo-9537ac63aacbeb05b45f2bac908bd1f04e79de2f.tar.gz
brdo-9537ac63aacbeb05b45f2bac908bd1f04e79de2f.tar.bz2
- Patch #793388 by StuartJNCC, David_Rothstein: attempting to update D6 to D7 without PDO enabled causes WSOD.
-rw-r--r--includes/update.inc17
1 files changed, 17 insertions, 0 deletions
diff --git a/includes/update.inc b/includes/update.inc
index 950886bbc..ff641a925 100644
--- a/includes/update.inc
+++ b/includes/update.inc
@@ -99,6 +99,23 @@ function update_prepare_d7_bootstrap() {
// that occur by creating a static list.
$GLOBALS['conf']['blocked_ips'] = array();
+ // Check that PDO is available and that the correct PDO database driver is
+ // loaded. Bootstrapping to DRUPAL_BOOTSTRAP_DATABASE will result in a fatal
+ // error otherwise.
+ $message = '';
+ // Check that PDO is loaded.
+ if (!extension_loaded('pdo')) {
+ $message = '<h2>PDO is required!</h2><p>Drupal 7 requires PHP ' . DRUPAL_MINIMUM_PHP . ' or higher with the PHP Data Objects (PDO) extension enabled.</p>';
+ }
+ // Check that the correct driver is loaded for the database being updated.
+ elseif (!in_array($databases['default']['default']['driver'], PDO::getAvailableDrivers())) {
+ $message = '<h2>A PDO database driver is required!</h2><p>You need to enable the PDO_' . strtoupper($databases['default']['default']['driver']) . ' database driver for PHP ' . DRUPAL_MINIMUM_PHP . ' or higher so that Drupal 7 can access the database.</p>';
+ }
+ if ($message) {
+ print $message . '<p>See the <a href="http://drupal.org/requirements">system requirements page</a> for more information.</p>';
+ exit();
+ }
+
// Allow the database system to work even if the registry has not been
// created yet.
drupal_bootstrap(DRUPAL_BOOTSTRAP_DATABASE);