Commit f8aa38a1 authored by Dries's avatar Dries
Browse files

- Patch #298391 by Rob Loach: database engine initialization fails in presence of CVS directory.

parent 8b003019
...@@ -208,18 +208,17 @@ function drupal_detect_baseurl($file = 'install.php') { ...@@ -208,18 +208,17 @@ function drupal_detect_baseurl($file = 'install.php') {
function drupal_detect_database_types() { function drupal_detect_database_types() {
$databases = array(); $databases = array();
foreach (scandir('./includes/database') as $driver) { // We define a driver as a directory in /includes/database that in turn
$driver_dir = './includes/database/' . $driver; // contains a database.inc file. That allows us to drop in additional drivers
if (!is_dir($driver_dir) || strpos($driver, '.') === 0) { // without modifying the installer.
continue; // Because we have no registry yet, we need to also include the install.inc
// file for the driver explicitly.
foreach (glob('./includes/database/*/{install,database}.inc', GLOB_BRACE) as $file) {
include_once($file);
$drivers[max(explode('/', $file, -1))] = $file;
} }
$drivers[] = $driver; foreach ($drivers as $driver => $file) {
// We of course cannot rely on the registry at this point.
include_once($driver_dir . '/database.inc');
include_once($install_file = $driver_dir . '/install.inc');
$class = 'DatabaseInstaller_' . $driver; $class = 'DatabaseInstaller_' . $driver;
$installer = new $class(); $installer = new $class();
if ($installer->installable()) { if ($installer->installable()) {
......
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