Modified slave validation

.gitignore composer.lock, and remove composer.lock from repo
This commit is contained in:
Tiago Peralta 2017-12-10 20:46:30 +00:00
parent 142261d4e0
commit c5ca7a83b2
3 changed files with 3 additions and 1360 deletions

2
.gitignore vendored
View File

@ -43,4 +43,4 @@ tests/_output/*
/nbproject/*
# No need for composer.lock
composer.lock
/composer.lock

1358
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -47,7 +47,7 @@ class mysqlims extends mysqli
throw new Exception("Failed to connect to MySQL: (".$this->mysqliW->connect_errno.") ".$this->mysqliW->connect_error);
}
if ($this->mysqliR->connect_errno && $this->slave === true) {
if ($this->slave === true && $this->mysqliR->connect_errno) {
throw new Exception("Failed to connect to MySQL: (".$this->mysqliR->connect_errno.") ".$this->mysqliR->connect_error);
}
}
@ -60,6 +60,7 @@ class mysqlims extends mysqli
*/
public function prepare($query)
{
mysqli::prepare($query);
if (stripos($query, "SELECT") && stripos($query, "FOR UPDATE") === false && $this->slave !== false) {
return $this->mysqliR->prepare($query);
} else {