@@ -83,19 +83,19 @@ discard block |
||
83 | 83 | } |
84 | 84 | if ($this->connectionAttempt >= $this->maxConnectErrors) { |
85 | 85 | exit; |
86 | - $this->halt("connect($host, $user, \$password) failed. ".(is_object($this->linkId) && isset( $this->linkId->connect_error) ? $this->linkId->connect_error : '')); |
|
86 | + $this->halt("connect($host, $user, \$password) failed. ".(is_object($this->linkId) && isset($this->linkId->connect_error) ? $this->linkId->connect_error : '')); |
|
87 | 87 | return 0; |
88 | 88 | } |
89 | 89 | //error_log("real_connect($host, $user, $password, $database, $port)"); |
90 | 90 | $this->linkId = mysqli_init(); |
91 | 91 | $this->linkId->options(MYSQLI_INIT_COMMAND, "SET NAMES {$this->characterSet} COLLATE {$this->collation}, COLLATION_CONNECTION = {$this->collation}, COLLATION_DATABASE = {$this->collation}"); |
92 | 92 | if (!$this->linkId->real_connect($host, $user, $password, $database, $port != '' ? $port : NULL)) { |
93 | - $this->halt("connect($host, $user, \$password) failed. ".(is_object($this->linkId) && isset( $this->linkId->connect_error) ? $this->linkId->connect_error : '')); |
|
93 | + $this->halt("connect($host, $user, \$password) failed. ".(is_object($this->linkId) && isset($this->linkId->connect_error) ? $this->linkId->connect_error : '')); |
|
94 | 94 | return 0; |
95 | 95 | } |
96 | 96 | $this->linkId->set_charset($this->characterSet); |
97 | 97 | if ($this->linkId->connect_errno) { |
98 | - $this->halt("connect($host, $user, \$password) failed. ".(is_object($this->linkId) && isset( $this->linkId->connect_error) ? $this->linkId->connect_error : '')); |
|
98 | + $this->halt("connect($host, $user, \$password) failed. ".(is_object($this->linkId) && isset($this->linkId->connect_error) ? $this->linkId->connect_error : '')); |
|
99 | 99 | return 0; |
100 | 100 | } |
101 | 101 | } |
@@ -257,24 +257,24 @@ discard block |
||
257 | 257 | $fails++; |
258 | 258 | try { |
259 | 259 | $this->queryId = @mysqli_query($this->linkId, $queryString, MYSQLI_STORE_RESULT); |
260 | - if (in_array((int)@mysqli_errno($this->linkId), [1213, 2006, 3101, 1180])) { |
|
260 | + if (in_array((int) @mysqli_errno($this->linkId), [1213, 2006, 3101, 1180])) { |
|
261 | 261 | //error_log("got ".@mysqli_errno($this->linkId)." sql error fails {$fails} on query {$queryString} from {$line}:{$file}"); |
262 | 262 | usleep(250000); // 0.25 second |
263 | 263 | } else { |
264 | 264 | $onlyRollback = false; |
265 | - if (in_array((int)@mysqli_errno($this->linkId), [1064])) { |
|
265 | + if (in_array((int) @mysqli_errno($this->linkId), [1064])) { |
|
266 | 266 | $tries = 0; |
267 | 267 | } |
268 | 268 | break; |
269 | 269 | } |
270 | 270 | } catch (\mysqli_sql_exception $e) { |
271 | - if (in_array((int)$e->getCode(), [1213, 2006, 3101, 1180])) { |
|
271 | + if (in_array((int) $e->getCode(), [1213, 2006, 3101, 1180])) { |
|
272 | 272 | //error_log("got ".$e->getCode()." sql error fails {$fails}"); |
273 | 273 | usleep(250000); // 0.25 second |
274 | 274 | } else { |
275 | 275 | error_log('Got mysqli_sql_exception code '.$e->getCode().' error '.$e->getMessage().' on query '.$queryString.' from '.$line.':'.$file); |
276 | 276 | $onlyRollback = false; |
277 | - if (in_array((int)@mysqli_errno($this->linkId), [1064])) { |
|
277 | + if (in_array((int) @mysqli_errno($this->linkId), [1064])) { |
|
278 | 278 | $tries = 0; |
279 | 279 | } |
280 | 280 | break; |