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