Commit f8dea099 authored by webchick's avatar webchick

#853748 by Stevel, andypost: Fixed Folders in includes/database that do not...

#853748 by Stevel, andypost: Fixed Folders in includes/database that do not contain an (installable) driver are used anyway.
parent bb28a4d4
......@@ -237,7 +237,9 @@ function drupal_detect_database_types() {
require_once DRUPAL_ROOT . '/includes/database/database.inc';
spl_autoload_register('db_autoload');
foreach (file_scan_directory(DRUPAL_ROOT . '/includes/database', '/^[a-z]*$/i', array('recurse' => FALSE)) as $file) {
$drivers[$file->filename] = $file->uri;
if (file_exists($file->uri . '/database.inc') && file_exists($file->uri . '/install.inc')) {
$drivers[$file->filename] = $file->uri;
}
}
foreach ($drivers as $driver => $file) {
......
......@@ -141,27 +141,29 @@ function system_requirements($phase) {
$requirements['php_extensions']['value'] = $t('Enabled');
}
// Test for PDO (database).
$requirements['database_extensions'] = array(
'title' => $t('Database support'),
);
if ($phase == 'install' || $phase == 'update') {
// Test for PDO (database).
$requirements['database_extensions'] = array(
'title' => $t('Database support'),
);
// Test for at least one suitable PDO extension, if PDO is available.
$database_ok = extension_loaded('pdo');
if ($database_ok) {
$drivers = drupal_detect_database_types();
$database_ok = !empty($drivers);
}
// Test for at least one suitable PDO extension, if PDO is available.
$database_ok = extension_loaded('pdo');
if ($database_ok) {
$drivers = drupal_detect_database_types();
$database_ok = !empty($drivers);
}
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',
));
}
else {
$requirements['database_extensions']['value'] = $t('Enabled');
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',
));
}
else {
$requirements['database_extensions']['value'] = $t('Enabled');
}
}
// Test PHP memory_limit
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment