From a4f4c6b5a4370025dc91174258cc8577cc83e187 Mon Sep 17 00:00:00 2001 From: "M@dD3n" Date: Thu, 19 Sep 2019 13:38:27 +0300 Subject: [PATCH] Fixes --- class/class.database.php | 19 +++++++++++++++++++ inc/init.php | 6 ++++-- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/class/class.database.php b/class/class.database.php index 48ee16b..837c010 100755 --- a/class/class.database.php +++ b/class/class.database.php @@ -483,6 +483,25 @@ } + /** + * Задает Sql Mode + * + * @param string $charset + * + * @throws AVE_DB_Exception + * @return AVE_DB + */ + public function setSqlMode() + { + if (!$this->mysqli->query("SET SQL_MODE = ''")) + { + throw new AVE_DB_Exception(__METHOD__ . ': ' . $this->mysqli->error); + } + + return $this; + } + + /** * Устанавливает имя используемой СУБД. * diff --git a/inc/init.php b/inc/init.php index 1090ba2..d05b332 100644 --- a/inc/init.php +++ b/inc/init.php @@ -187,11 +187,11 @@ //-- Debug Class require (BASE_DIR . '/class/class.debug.php'); - $Debug = new Debug; + new Debug; //-- Hooks Class require (BASE_DIR . '/class/class.hooks.php'); - $Hooks = new Hooks; + new Hooks; //-- Подкючаем необходимые файлы функций require_once (BASE_DIR . '/functions/func.breadcrumbs.php'); // Хлебные крошки @@ -249,6 +249,8 @@ ->setCharset('utf8') //-- Назначаем БД ->setDatabaseName($config['dbname']); + //-- SQL Mode + ->setSqlMode(); } catch (AVE_DB_Exception $e) {