mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
f6786406ef
|
@ -37,6 +37,10 @@ if (!file_exists("create_tables-sqlite3.sql")) {
|
|||
echo "Can't install SeedDMS, 'create_tables-sqlite3.sql' missing";
|
||||
exit;
|
||||
}
|
||||
if (!file_exists("create_tables-postgres.sql")) {
|
||||
echo "Can't install SeedDMS, 'create_tables-postgres.sql' missing";
|
||||
exit;
|
||||
}
|
||||
if (!file_exists("settings.xml.template_install")) {
|
||||
echo "Can't install SeedDMS, 'settings.xml.template_install' missing";
|
||||
exit;
|
||||
|
@ -50,6 +54,7 @@ function openDBConnection($settings) { /* {{{ */
|
|||
case 'mysql':
|
||||
case 'mysqli':
|
||||
case 'mysqlnd':
|
||||
case 'pgsql':
|
||||
$tmp = explode(":", $settings->_dbHostname);
|
||||
$dsn = $settings->_dbDriver.":dbname=".$settings->_dbDatabase.";host=".$tmp[0];
|
||||
if(isset($tmp[1]))
|
||||
|
@ -297,6 +302,8 @@ if ($action=="setSettings") {
|
|||
$queries = file_get_contents("create_tables-innodb.sql");
|
||||
elseif($settings->_dbDriver=="sqlite")
|
||||
$queries = file_get_contents("create_tables-sqlite3.sql");
|
||||
elseif($settings->_dbDriver=="pgsql")
|
||||
$queries = file_get_contents("create_tables-postgres.sql");
|
||||
else
|
||||
die();
|
||||
|
||||
|
|
|
@ -49,13 +49,23 @@ switch($settings->_dbDriver) {
|
|||
case 'mysql':
|
||||
case 'mysqli':
|
||||
case 'mysqlnd':
|
||||
$dsn = $settings->_dbDriver.":dbname=".$settings->_dbDatabase.";host=".$settings->_dbHostname;
|
||||
$tmp = explode(":", $settings->_dbHostname);
|
||||
$dsn = $settings->_dbDriver.":dbname=".$settings->_dbDatabase.";host=".$tmp[0];
|
||||
if(isset($tmp[1]))
|
||||
$dsn .= ";port=".$tmp[1];
|
||||
break;
|
||||
case 'sqlite':
|
||||
$dsn = $settings->_dbDriver.":".$settings->_dbDatabase;
|
||||
if(file_exists('update-'.$_GET['version'].'/update-sqlite3.sql'))
|
||||
$sqlfile = "update-sqlite3.sql";
|
||||
break;
|
||||
case 'pgsql':
|
||||
$tmp = explode(":", $settings->_dbHostname);
|
||||
$dsn = $settings->_dbDriver.":dbname=".$settings->_dbDatabase.";host=".$tmp[0];
|
||||
if(isset($tmp[1]))
|
||||
$dsn .= ";port=".$tmp[1];
|
||||
if(file_exists('update-'.$_GET['version'].'/update-postgres.sql'))
|
||||
$sqlfile = "update-postgres.sql";
|
||||
}
|
||||
$db = new PDO($dsn, $settings->_dbUser, $settings->_dbPass);
|
||||
if (!$db) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user