aboutsummaryrefslogtreecommitdiff
path: root/lib/Minz/ModelPdo.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-07-30 18:45:34 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-07-30 18:45:34 +0200
commitfe18d12551f626c56257f825caf8f97a4a5461ce (patch)
treebb494e7eea4589d0c08f29e644a9ed07897d4d62 /lib/Minz/ModelPdo.php
parenta78b3f5e7f19a1f1320fcb12f7c8b450f9a9dba4 (diff)
Update MySQL to utf8mb4 (full unicode) 🔥
* Requires MySQL 5.5.3+ (drop support for MySQL 5.0) * Requires PHP 5.3.3+ (drop support for PHP 5.3.0) https://github.com/FreshRSS/FreshRSS/issues/789#issuecomment-73878076
Diffstat (limited to 'lib/Minz/ModelPdo.php')
-rw-r--r--lib/Minz/ModelPdo.php12
1 files changed, 4 insertions, 8 deletions
diff --git a/lib/Minz/ModelPdo.php b/lib/Minz/ModelPdo.php
index 25999f02b..845aecaae 100644
--- a/lib/Minz/ModelPdo.php
+++ b/lib/Minz/ModelPdo.php
@@ -16,7 +16,6 @@ class Minz_ModelPdo {
public static $useSharedBd = true;
private static $sharedBd = null;
private static $sharedPrefix;
- private static $has_transaction = false;
private static $sharedCurrentUser;
protected static $sharedDbType;
@@ -60,8 +59,8 @@ class Minz_ModelPdo {
if ($type === 'mysql') {
$string = 'mysql:host=' . $db['host']
. ';dbname=' . $db['base']
- . ';charset=utf8';
- $driver_options[PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET NAMES utf8';
+ . ';charset=utf8mb4';
+ $driver_options[PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET NAMES utf8mb4';
$this->prefix = $db['prefix'] . $currentUser . '_';
} elseif ($type === 'sqlite') {
$string = 'sqlite:' . join_path(DATA_PATH, 'users', $currentUser, 'db.sqlite');
@@ -96,18 +95,15 @@ class Minz_ModelPdo {
public function beginTransaction() {
$this->bd->beginTransaction();
- self::$has_transaction = true;
}
- public function hasTransaction() {
- return self::$has_transaction;
+ public function inTransaction() {
+ return $this->bd->inTransaction(); //requires PHP >= 5.3.3
}
public function commit() {
$this->bd->commit();
- self::$has_transaction = false;
}
public function rollBack() {
$this->bd->rollBack();
- self::$has_transaction = false;
}
public static function clean() {