aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--admin/include/functions_install.inc.php23
-rw-r--r--include/config_default.inc.php10
-rw-r--r--include/dblayer/dblayers.inc.php2
-rw-r--r--install.php11
4 files changed, 25 insertions, 21 deletions
diff --git a/admin/include/functions_install.inc.php b/admin/include/functions_install.inc.php
index 48699cd29..7d8ae41e7 100644
--- a/admin/include/functions_install.inc.php
+++ b/admin/include/functions_install.inc.php
@@ -104,16 +104,21 @@ function available_engines()
}
}
- if ($engines['sqlite']['available'] && $engines['pdo-sqlite']['available'])
+ if ($engines['sqlite']['available'] and !$engines['pdo-sqlite']['available'])
{
- if ($GLOBALS['conf']['db_sqlite_default']=='native')
- {
- unset($engines['pdo-sqlite']);
- }
- else
- {
- unset($engines['sqlite']);
- }
+ unset($engines['pdo-sqlite']);
+ }
+ elseif ($engines['pdo-sqlite']['available'] and !$engines['sqlite']['available'])
+ {
+ unset($engines['sqlite']);
+ }
+ elseif (DEFAULT_DB_SQLITE=='native')
+ {
+ unset($engines['pdo-sqlite']);
+ }
+ else
+ {
+ unset($engines['sqlite']);
}
return $engines;
diff --git a/include/config_default.inc.php b/include/config_default.inc.php
index b6ee06e4d..0850723f6 100644
--- a/include/config_default.inc.php
+++ b/include/config_default.inc.php
@@ -528,16 +528,6 @@ $conf['user_fields'] = array(
'email' => 'mail_address'
);
-// database engine default choice between sqlite (native or via pdo)
-// if the twice are available.
-// $conf['db_sqlite_default'] = 'pdo';
-$conf['db_sqlite_default'] = 'native';
-
-// default database engine proposed if severals are available
-// choices : sqlite, mysql, pgsql, pdo-sqlite
-// see include/dblayer/dblayers.inc.php
-$conf['dbengine_select_default'] = 'mysql';
-
// pass_convert : function to crypt or hash the clear user password to store
// it in the database
$conf['pass_convert'] = create_function('$s', 'return md5($s);');
diff --git a/include/dblayer/dblayers.inc.php b/include/dblayer/dblayers.inc.php
index ec650a384..cfa543998 100644
--- a/include/dblayer/dblayers.inc.php
+++ b/include/dblayer/dblayers.inc.php
@@ -34,7 +34,7 @@ $dblayers['sqlite'] = array('engine' => 'SQLite',
'function_available' => 'sqlite_open'
);
-$dblayers['pdo-sqlite'] = array('engine' => 'PDO::SQLite',
+$dblayers['pdo-sqlite'] = array('engine' => 'SQLite',
'class_available' => 'PDO'
);
diff --git a/install.php b/install.php
index d722288f5..080b262e1 100644
--- a/install.php
+++ b/install.php
@@ -98,6 +98,15 @@ if( !@get_magic_quotes_gpc() )
define('DEFAULT_PREFIX_TABLE', 'piwigo_');
+// default database engine proposed if severals are available
+// choices : sqlite, mysql, pgsql, pdo-sqlite
+// see include/dblayer/dblayers.inc.php
+define('DEFAULT_DB_ENGINE', 'mysql');
+
+// database engine default choice between sqlite (native or via pdo)
+// if the twice are available.
+define('DEFAULT_DB_SQLITE', 'native');
+
if (isset($_POST['install']))
{
$prefixeTable = $_POST['prefix'];
@@ -115,7 +124,7 @@ $dbhost = (!empty($_POST['dbhost'])) ? $_POST['dbhost'] : 'localhost';
$dbuser = (!empty($_POST['dbuser'])) ? $_POST['dbuser'] : '';
$dbpasswd = (!empty($_POST['dbpasswd'])) ? $_POST['dbpasswd'] : '';
$dbname = (!empty($_POST['dbname'])) ? $_POST['dbname'] : '';
-$dblayer = (!empty($_POST['dblayer'])) ? $_POST['dblayer'] : $conf['dbengine_select_default'];
+$dblayer = (!empty($_POST['dblayer'])) ? $_POST['dblayer'] : DEFAULT_DB_ENGINE;
$admin_name = (!empty($_POST['admin_name'])) ? $_POST['admin_name'] : '';
$admin_pass1 = (!empty($_POST['admin_pass1'])) ? $_POST['admin_pass1'] : '';