- switched system jump/kill-data update cronjob from XML API to ESI

- use internal DEBUG level for MySQL ERRORMODE
- increased MySQL version 5.6 => 5.7
- fixed bug in System auto search form element (select2)
- code cleanup
This commit is contained in:
Exodus4D
2017-04-13 00:36:12 +02:00
parent 446949738b
commit bc7b7154be
13 changed files with 60 additions and 169 deletions

View File

@@ -98,17 +98,26 @@ class Database extends \Prefab {
*/
protected function connect($dns, $name, $user, $password){
$db = null;
$f3 = \Base::instance();
$options = [
\PDO::MYSQL_ATTR_COMPRESS => true,
\PDO::ATTR_TIMEOUT => \Base::instance()->get('REQUIREMENTS.MYSQL.PDO_TIMEOUT'),
];
// set ERRMODE depending on pathfinders global DEBUG level
if($f3->get('DEBUG') >= 3){
$options[\PDO::ATTR_ERRMODE] = \PDO::ERRMODE_WARNING;
}else{
$options[\PDO::ATTR_ERRMODE] = \PDO::ERRMODE_EXCEPTION;
}
try {
$db = new SQL(
$dns . $name,
$user,
$password,
[
\PDO::MYSQL_ATTR_COMPRESS => true,
\PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION,
\PDO::ATTR_TIMEOUT => \Base::instance()->get('REQUIREMENTS.MYSQL.PDO_TIMEOUT'),
]
$options
);
}catch(\PDOException $e){
// DB connection error