]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - inc/poche/Database.class.php
set registration to false
[github/wallabag/wallabag.git] / inc / poche / Database.class.php
index 6bac0f5d0e76d54b186d3b7fb33682ff150bd220..a987b7cc7be88e8551574357cc3ef998e94b818b 100755 (executable)
@@ -31,10 +31,15 @@ class Database {
                 $this->handle = new PDO($db_path);
                 break;
             case 'mysql':
-                $db_path = 'mysql:host=' . STORAGE_SERVER . ';dbname=' . STORAGE_DB . ';charset=utf8mb4';
-                $this->handle = new PDO($db_path, STORAGE_USER, STORAGE_PASSWORD, array(
-                    PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4',
-                ));
+                if (MYSQL_USE_UTF8MB4) {
+                    $db_path = 'mysql:host=' . STORAGE_SERVER . ';dbname=' . STORAGE_DB . ';charset=utf8mb4';
+                    $this->handle = new PDO($db_path, STORAGE_USER, STORAGE_PASSWORD, array(
+                        PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8mb4',
+                    ));
+                } else {
+                    $db_path = 'mysql:host=' . STORAGE_SERVER . ';dbname=' . STORAGE_DB;
+                    $this->handle = new PDO($db_path, STORAGE_USER, STORAGE_PASSWORD);
+                }
                 break;
             case 'postgres':
                 $db_path = 'pgsql:host=' . STORAGE_SERVER . ';dbname=' . STORAGE_DB;