summaryrefslogtreecommitdiff
path: root/modules/system/system.install
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2010-10-12 02:50:03 +0000
committerDries Buytaert <dries@buytaert.net>2010-10-12 02:50:03 +0000
commit738367593558ba170cb6d65dda35ec9230654bc3 (patch)
tree4a8025e4e16aba7be4aeee0ae179e6866cd12d94 /modules/system/system.install
parent563c673ea3b8977e9f739f7979acb62abcd78310 (diff)
downloadbrdo-738367593558ba170cb6d65dda35ec9230654bc3.tar.gz
brdo-738367593558ba170cb6d65dda35ec9230654bc3.tar.bz2
- Patch #818374 by Damien Tournoud, ksenzee, Dave Reid: add a requirements check error if PECL PDO is being used.
Diffstat (limited to 'modules/system/system.install')
-rw-r--r--modules/system/system.install29
1 files changed, 23 insertions, 6 deletions
diff --git a/modules/system/system.install b/modules/system/system.install
index 9c9bc2d8c..e37b7b5e2 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -144,19 +144,36 @@ function system_requirements($phase) {
'title' => $t('Database support'),
);
- // Test for at least one suitable PDO extension, if PDO is available.
+ // Make sure PDO is available.
$database_ok = extension_loaded('pdo');
- if ($database_ok) {
+ if (!$database_ok) {
+ $pdo_message = $t('Your web server does not appear to support PDO (PHP Data Objects). Ask your hosting provider if they support the native PDO extension. See the <a href="@link">system requirements</a> page for more information.', array(
+ '@link' => 'http://drupal.org/requirements/pdo',
+ ));
+ }
+ else {
+ // Make sure at least one supported database driver exists.
$drivers = drupal_detect_database_types();
- $database_ok = !empty($drivers);
+ if (empty($drivers)) {
+ $database_ok = FALSE;
+ $pdo_message = $t('Your web server does not appear to support any common PDO database extensions. Check with your hosting provider to see if they support PDO (PHP Data Objects) and offer any databases that <a href="@drupal-databases">Drupal supports</a>.', array(
+ '@drupal-databases' => 'http://drupal.org/node/270#database',
+ ));
+ }
+ // Make sure the native PDO extension is available, not the older PEAR
+ // version. (See install_verify_pdo() for details.)
+ if (!defined('PDO::ATTR_DEFAULT_FETCH_MODE')) {
+ $database_ok = FALSE;
+ $pdo_message = $t('Your web server seems to have the wrong version of PDO installed. Drupal 7 requires the PDO extension from PHP core. This system has the older PECL version. See the <a href="@link">system requirements</a> page for more information.', array(
+ '@link' => 'http://drupal.org/requirements/pdo#pecl',
+ ));
+ }
}
if (!$database_ok) {
$requirements['database_extensions']['value'] = $t('Disabled');
$requirements['database_extensions']['severity'] = REQUIREMENT_ERROR;
- $requirements['database_extensions']['description'] = $t('Your web server does not appear to support any common PDO database extensions. Check with your hosting provider to see if they support PDO (PHP Data Objects) and offer any databases that <a href="@drupal-databases">Drupal supports</a>.', array(
- '@drupal-databases' => 'http://drupal.org/node/270#database',
- ));
+ $requirements['database_extensions']['description'] = $pdo_message;
}
else {
$requirements['database_extensions']['value'] = $t('Enabled');