diff options
Diffstat (limited to 'inc/poche/Database.class.php')
-rwxr-xr-x | inc/poche/Database.class.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 6bac0f5d..a987b7cc 100755 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php | |||
@@ -31,10 +31,15 @@ class Database { | |||
31 | $this->handle = new PDO($db_path); | 31 | $this->handle = new PDO($db_path); |
32 | break; | 32 | break; |
33 | case 'mysql': | 33 | case 'mysql': |
34 | $db_path = 'mysql:host=' . STORAGE_SERVER . ';dbname=' . STORAGE_DB . ';charset=utf8mb4'; | 34 | if (MYSQL_USE_UTF8MB4) { |
35 | $this->handle = new PDO($db_path, STORAGE_USER, STORAGE_PASSWORD, array( | 35 | $db_path = 'mysql:host=' . STORAGE_SERVER . ';dbname=' . STORAGE_DB . ';charset=utf8mb4'; |
36 | PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4', | 36 | $this->handle = new PDO($db_path, STORAGE_USER, STORAGE_PASSWORD, array( |
37 | )); | 37 | PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4', |
38 | )); | ||
39 | } else { | ||
40 | $db_path = 'mysql:host=' . STORAGE_SERVER . ';dbname=' . STORAGE_DB; | ||
41 | $this->handle = new PDO($db_path, STORAGE_USER, STORAGE_PASSWORD); | ||
42 | } | ||
38 | break; | 43 | break; |
39 | case 'postgres': | 44 | case 'postgres': |
40 | $db_path = 'pgsql:host=' . STORAGE_SERVER . ';dbname=' . STORAGE_DB; | 45 | $db_path = 'pgsql:host=' . STORAGE_SERVER . ';dbname=' . STORAGE_DB; |