Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2021-08-05 08:42:34 +02:00
commit 8bc9ab8f3c
5 changed files with 25 additions and 18 deletions

View File

@ -480,7 +480,7 @@ class SeedDMS_Core_DMS {
$this->lasterror = ''; $this->lasterror = '';
$this->version = '@package_version@'; $this->version = '@package_version@';
if($this->version[0] == '@') if($this->version[0] == '@')
$this->version = '6.0.14'; $this->version = '6.0.16';
} /* }}} */ } /* }}} */
/** /**

View File

@ -295,22 +295,26 @@ class SeedDMS_Core_DatabaseAccess {
$dsn = $this->_driver.":".$this->_database; $dsn = $this->_driver.":".$this->_database;
break; break;
} }
/** @noinspection PhpUndefinedVariableInspection */ try {
$this->_conn = new PDO($dsn, $this->_user, $this->_passw); /** @noinspection PhpUndefinedVariableInspection */
if (!$this->_conn) $this->_conn = new PDO($dsn, $this->_user, $this->_passw);
return false; if (!$this->_conn)
return false;
switch($this->_driver) { switch($this->_driver) {
case 'mysql': case 'mysql':
$this->_conn->exec('SET NAMES utf8'); $this->_conn->exec('SET NAMES utf8');
/* Turn this on if you want strict checking of default values, etc. */ /* Turn this on if you want strict checking of default values, etc. */
// $this->_conn->exec("SET SESSION sql_mode = 'STRICT_TRANS_TABLES'"); /* $this->_conn->exec("SET SESSION sql_mode = 'STRICT_TRANS_TABLES'"); */
/* The following is the default on Ubuntu 16.04 */ /* The following is the default on Ubuntu 16.04 */
// $this->_conn->exec("SET SESSION sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'"); /* $this->_conn->exec("SET SESSION sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'"); */
break; break;
case 'sqlite': case 'sqlite':
$this->_conn->exec('PRAGMA foreign_keys = ON'); $this->_conn->exec('PRAGMA foreign_keys = ON');
break; break;
}
} catch (Exception $e) {
return false;
} }
if($this->_useviews) { if($this->_useviews) {
$tmp = $this->ViewList(); $tmp = $this->ViewList();

View File

@ -1072,7 +1072,7 @@ class Settings { /* {{{ */
$this->setXMLAttributValue($node, "dbDatabase", $this->_dbDatabase); $this->setXMLAttributValue($node, "dbDatabase", $this->_dbDatabase);
$this->setXMLAttributValue($node, "dbUser", $this->_dbUser); $this->setXMLAttributValue($node, "dbUser", $this->_dbUser);
$this->setXMLAttributValue($node, "dbPass", $this->_dbPass); $this->setXMLAttributValue($node, "dbPass", $this->_dbPass);
$this->setXMLAttributValue($node, "doNotCheckVersion", $this->_doNotCheckDBVersion); $this->setXMLAttributValue($node, "doNotCheckDBVersion", $this->_doNotCheckDBVersion);
// XML Path: /configuration/system/smtp // XML Path: /configuration/system/smtp
$node = $this->getXMLNode($xml, '/configuration/system', 'smtp'); $node = $this->getXMLNode($xml, '/configuration/system', 'smtp');

View File

@ -49,6 +49,9 @@ $dms = new SeedDMS_Core_DMS($db, $settings->_contentDir.$settings->_contentOffse
if(!$settings->_doNotCheckDBVersion && !$dms->checkVersion()) { if(!$settings->_doNotCheckDBVersion && !$dms->checkVersion()) {
echo "Database update needed."; echo "Database update needed.";
if($v = $dms->getDBVersion()) {
echo " Database has version ".$v['major'].".".$v['minor'].".".$v['subminor']." but this is SeedDMS ".$dms->version.".";
}
exit; exit;
} }

View File

@ -80,7 +80,7 @@ if (!$configDir) {
} }
if (!file_exists($configDir."/ENABLE_INSTALL_TOOL")) { if (!file_exists($configDir."/ENABLE_INSTALL_TOOL")) {
echo "For installation of SeedDMS, you must create the file ".$configDir."ENABLE_INSTALL_TOOL"; echo "For installation of SeedDMS, you must create the file ".$configDir."/ENABLE_INSTALL_TOOL";
exit; exit;
} }