diff --git a/core/config.php b/core/config.php index e87f75d..d7ce928 100644 --- a/core/config.php +++ b/core/config.php @@ -3,13 +3,18 @@ /** * Версия сервиса */ - const VERSION = '1.0.0'; + const CORE_VERSION = '1.0.0_dev'; /** * Путь до корня проекта */ define('ROOT_PATH', $_SERVER['DOCUMENT_ROOT']); + /** + * Путь до папки ядра + */ + const CORE_PATH = ROOT_PATH . '/core'; + /** * Путь до папки загрузок */ @@ -20,9 +25,8 @@ */ define('LOG_PATH', $_SERVER['DOCUMENT_ROOT'] . '/core/log'); - /** - * БД + * Параметры SQL базы */ const DB_HOST = 'localhost'; const DB_USER = 'rsgrinko_delta'; @@ -72,5 +76,5 @@ /** * Флаг использования логирования */ - const USE_LOG = true; + const USE_LOG = false; diff --git a/core/lib/Core/Models/DB.class.php b/core/lib/Core/Models/DB.class.php index 57a4beb..edb31c1 100644 --- a/core/lib/Core/Models/DB.class.php +++ b/core/lib/Core/Models/DB.class.php @@ -49,7 +49,6 @@ */ public function __construct(string $db_server = DB_HOST, string $db_user = DB_USER, ?string $db_pass = DB_PASSWORD, string $db_name = DB_NAME) { - if (DB_TYPE === DB_TYPE_SQL) { $dsn = 'mysql:host=' . $db_server . ';dbname=' . $db_name . ';charset=utf8'; $opt = [ \PDO::ATTR_ERRMODE => \PDO::ERRMODE_EXCEPTION, @@ -57,9 +56,6 @@ \PDO::ATTR_EMULATE_PREPARES => false, ]; $this->db = new \PDO($dsn, $db_user, $db_pass, $opt); - } elseif (DB_TYPE === DB_TYPE_SQLITE) { - $this->db = new \SQLite3(SQLITE_DB_FILE); - } } /** @@ -194,8 +190,6 @@ { $startTime = microtime(true); self::$quantity++; - - if(DB_TYPE === DB_TYPE_SQL) { try { $stmt = $this->db->query($sql); } catch (\Throwable $t) { @@ -213,10 +207,6 @@ $result = $stmt->fetchAll(); return $result ?: null; } - } elseif(DB_TYPE === DB_TYPE_SQLITE) { - $result = $this->db->query($sql); - return $result->fetchArray(SQLITE3_ASSOC); - } } /**