From e5511ec801df01a89607f68fd9e29f09b8b798da Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 9 Aug 2015 15:39:00 +0100 Subject: [PATCH] wtf, php --- core/database.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/database.class.php b/core/database.class.php index f0dfafce..3801dbef 100644 --- a/core/database.class.php +++ b/core/database.class.php @@ -465,8 +465,14 @@ class Database { if(preg_match("/user=([^;]*)/", DATABASE_DSN, $matches)) $db_user=$matches[1]; if(preg_match("/password=([^;]*)/", DATABASE_DSN, $matches)) $db_pass=$matches[1]; + // https://bugs.php.net/bug.php?id=70221 + $ka = DATABASE_KA; + if(version_compare(PHP_VERSION, "6.9.9") == 1 && $this->get_driver_name() == "sqlite") { + $ka = false; + } + $db_params = array( - PDO::ATTR_PERSISTENT => DATABASE_KA, + PDO::ATTR_PERSISTENT => $ka, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION ); $this->db = new PDO(DATABASE_DSN, $db_user, $db_pass, $db_params);