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
8bc9ab8f3c
|
@ -480,7 +480,7 @@ class SeedDMS_Core_DMS {
|
|||
$this->lasterror = '';
|
||||
$this->version = '@package_version@';
|
||||
if($this->version[0] == '@')
|
||||
$this->version = '6.0.14';
|
||||
$this->version = '6.0.16';
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
|
|
|
@ -295,22 +295,26 @@ class SeedDMS_Core_DatabaseAccess {
|
|||
$dsn = $this->_driver.":".$this->_database;
|
||||
break;
|
||||
}
|
||||
/** @noinspection PhpUndefinedVariableInspection */
|
||||
$this->_conn = new PDO($dsn, $this->_user, $this->_passw);
|
||||
if (!$this->_conn)
|
||||
return false;
|
||||
try {
|
||||
/** @noinspection PhpUndefinedVariableInspection */
|
||||
$this->_conn = new PDO($dsn, $this->_user, $this->_passw);
|
||||
if (!$this->_conn)
|
||||
return false;
|
||||
|
||||
switch($this->_driver) {
|
||||
case 'mysql':
|
||||
$this->_conn->exec('SET NAMES utf8');
|
||||
/* Turn this on if you want strict checking of default values, etc. */
|
||||
// $this->_conn->exec("SET SESSION sql_mode = 'STRICT_TRANS_TABLES'");
|
||||
/* 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'");
|
||||
break;
|
||||
case 'sqlite':
|
||||
$this->_conn->exec('PRAGMA foreign_keys = ON');
|
||||
break;
|
||||
switch($this->_driver) {
|
||||
case 'mysql':
|
||||
$this->_conn->exec('SET NAMES utf8');
|
||||
/* Turn this on if you want strict checking of default values, etc. */
|
||||
/* $this->_conn->exec("SET SESSION sql_mode = 'STRICT_TRANS_TABLES'"); */
|
||||
/* 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'"); */
|
||||
break;
|
||||
case 'sqlite':
|
||||
$this->_conn->exec('PRAGMA foreign_keys = ON');
|
||||
break;
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return false;
|
||||
}
|
||||
if($this->_useviews) {
|
||||
$tmp = $this->ViewList();
|
||||
|
|
|
@ -1072,7 +1072,7 @@ class Settings { /* {{{ */
|
|||
$this->setXMLAttributValue($node, "dbDatabase", $this->_dbDatabase);
|
||||
$this->setXMLAttributValue($node, "dbUser", $this->_dbUser);
|
||||
$this->setXMLAttributValue($node, "dbPass", $this->_dbPass);
|
||||
$this->setXMLAttributValue($node, "doNotCheckVersion", $this->_doNotCheckDBVersion);
|
||||
$this->setXMLAttributValue($node, "doNotCheckDBVersion", $this->_doNotCheckDBVersion);
|
||||
|
||||
// XML Path: /configuration/system/smtp
|
||||
$node = $this->getXMLNode($xml, '/configuration/system', 'smtp');
|
||||
|
|
|
@ -49,6 +49,9 @@ $dms = new SeedDMS_Core_DMS($db, $settings->_contentDir.$settings->_contentOffse
|
|||
|
||||
if(!$settings->_doNotCheckDBVersion && !$dms->checkVersion()) {
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -80,7 +80,7 @@ if (!$configDir) {
|
|||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user