aboutsummaryrefslogtreecommitdiffstats
path: root/admin/include/functions_install.inc.php
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--admin/include/functions_install.inc.php39
1 files changed, 30 insertions, 9 deletions
diff --git a/admin/include/functions_install.inc.php b/admin/include/functions_install.inc.php
index 65b1a24d6..166ed6b7d 100644
--- a/admin/include/functions_install.inc.php
+++ b/admin/include/functions_install.inc.php
@@ -86,20 +86,41 @@ function available_engines()
foreach ($dblayers as $engine_name => $engine)
{
- if (file_exists(sprintf($pattern, $engine_name))
- && isset($engine['function_available'])
- && function_exists($engine['function_available']))
+ if (file_exists(sprintf($pattern, $engine_name)))
{
- $engines[$engine_name] = $engine['engine'];
+ $engines[$engine_name]['label'] = $engine['engine'];
+ $engines[$engine_name]['available'] = 'disabled';
+
+ if (isset($engine['function_available'])
+ && function_exists($engine['function_available']))
+ {
+ $engines[$engine_name]['available'] = true;
+ }
+ elseif (isset($engine['class_available'])
+ && class_exists($engine['class_available']))
+ {
+ $engines[$engine_name]['available'] = true;
+ }
+ }
+ }
+
+ if (count($engines)>1)
+ {
+ $engines[$GLOBALS['conf']['dbengine_select_default']]['selected'] = true;
+ }
+
+ if ($engines['sqlite']['available'] && $engines['pdo-sqlite']['available'])
+ {
+ if ($GLOBALS['conf']['db_sqlite_default']=='native')
+ {
+ unset($engines['pdo-sqlite']);
}
- elseif (file_exists(sprintf($pattern, $engine_name))
- && isset($engine['class_available'])
- && class_exists($engine['class_available']))
+ else
{
- $engines[$engine_name] = $engine['engine'];
+ unset($engines['sqlite']);
}
}
-
+
return $engines;
}
?> \ No newline at end of file