Commit 9739123c authored by Admin TiMMiT's avatar Admin TiMMiT

Merge branch '17-setwsrepsyncwait' into 'master'

Resolve "setWsrepSyncWait"

Closes #17

See merge request !31
parents 4dec98cc efc88696
{
"name": "timmit/db-mysql",
"description": "A simple DB layer in PHP for using MySQL(i)",
"version": "v4.1.1",
"version": "v4.2.0",
"keywords": ["DB", "MySQL", "MySQLi", "database", "DB layer", "database layer"],
"license": "MIT",
"homepage": "http://www.TiMMiT.nl/",
......@@ -13,7 +13,7 @@
}
],
"require": {
"php": ">=7.0.0"
"php": ">=7.2.0"
},
"minimum-stability": "dev",
"autoload": {
......
......@@ -2,7 +2,7 @@
/**
* A very simple class for using MySQL.
*
* PHP version 5.3+
* PHP version 7.2+
*
* @package TiMMiT/DB-MySQL
* @author Tim Schoondergang <tim.schoondergang@TiMMiT.nl>
......@@ -167,7 +167,7 @@ namespace TiMMiT\MySQL;
}
if (self::$writeActive && self::ping(true)) {
mysqli_set_charset(self::$mlinkWrite,self::$charset);
mysqli_query(self::$mlink,"SET SESSION wsrep_sync_wait = 1;");
DB::setWsrepSyncWait(true);
}
}
......@@ -897,6 +897,20 @@ namespace TiMMiT\MySQL;
self::executeQuery("SET foreign_key_checks=1;");
}
/**
* setWsrepSyncWait
* @param bool $on
* @return void
*/
public static function setWsrepSyncWait(bool $on=true): void
{
if($on){
mysqli_query(self::$mlink,"SET SESSION wsrep_sync_wait = 1;");
} else {
mysqli_query(self::$mlink,"SET SESSION wsrep_sync_wait = 0;");
}
}
/**
* add item tot stats
* @param string $queryType Soort Query
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment