diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-08-22 12:43:53 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-08-22 12:43:53 +0000 |
commit | f8aa38a1e1974f1a8f96118b82a8be92898f41cc (patch) | |
tree | 14ebce3228ac1b98ebed63c1171529d49e7db411 | |
parent | 8b0030199537b371e0536edf59cc00455f562f77 (diff) | |
download | brdo-f8aa38a1e1974f1a8f96118b82a8be92898f41cc.tar.gz brdo-f8aa38a1e1974f1a8f96118b82a8be92898f41cc.tar.bz2 |
- Patch #298391 by Rob Loach: database engine initialization fails in presence of CVS directory.
-rw-r--r-- | includes/install.inc | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/includes/install.inc b/includes/install.inc index 76cd30eb1..ce9e310a7 100644 --- a/includes/install.inc +++ b/includes/install.inc @@ -208,25 +208,24 @@ function drupal_detect_baseurl($file = 'install.php') { function drupal_detect_database_types() { $databases = array(); - foreach (scandir('./includes/database') as $driver) { - $driver_dir = './includes/database/' . $driver; - if (!is_dir($driver_dir) || strpos($driver, '.') === 0) { - continue; - } - - $drivers[] = $driver; - - // 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'); - + // We define a driver as a directory in /includes/database that in turn + // contains a database.inc file. That allows us to drop in additional drivers + // without modifying the installer. + // 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; + } + + foreach ($drivers as $driver => $file) { $class = 'DatabaseInstaller_' . $driver; $installer = new $class(); if ($installer->installable()) { $databases[$driver] = $installer->name(); } } - + return $databases; } |