@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | public function queryReturn($query, $line = '', $file = '') { |
171 | 171 | $this->query($query, $line, $file); |
172 | 172 | if ($this->num_rows() == 0) { |
173 | - return FALSE; |
|
173 | + return false; |
|
174 | 174 | } elseif ($this->num_rows() == 1) { |
175 | 175 | $this->next_record(MYSQLI_ASSOC); |
176 | 176 | return $this->Record; |
@@ -239,12 +239,12 @@ discard block |
||
239 | 239 | $this->free(); |
240 | 240 | if ($this->Debug) |
241 | 241 | printf("Debug: query = %s<br>\n", $queryString); |
242 | - if (isset($GLOBALS['log_queries']) && $GLOBALS['log_queries'] !== FALSE) |
|
242 | + if (isset($GLOBALS['log_queries']) && $GLOBALS['log_queries'] !== false) |
|
243 | 243 | $this->log($queryString, $line, $file); |
244 | 244 | $tries = 3; |
245 | 245 | $try = 0; |
246 | - $this->queryId = FALSE; |
|
247 | - while ((null === $this->queryId || $this->queryId === FALSE) && $try <= $tries) { |
|
246 | + $this->queryId = false; |
|
247 | + while ((null === $this->queryId || $this->queryId === false) && $try <= $tries) { |
|
248 | 248 | $try++; |
249 | 249 | if ($try > 1) { |
250 | 250 | @mysqli_close($this->linkId); |
@@ -254,10 +254,10 @@ discard block |
||
254 | 254 | $this->Row = 0; |
255 | 255 | $this->Errno = @mysqli_errno($this->linkId); |
256 | 256 | $this->Error = @mysqli_error($this->linkId); |
257 | - if ($try == 1 && (null === $this->queryId || $this->queryId === FALSE)) { |
|
257 | + if ($try == 1 && (null === $this->queryId || $this->queryId === false)) { |
|
258 | 258 | $email = "MySQLi Error<br>\n".'Query: '.$queryString."<br>\n".'Error #'.$this->Errno.': '.$this->Error."<br>\n".'Line: '.$line."<br>\n".'File: '.$file."<br>\n".(isset($GLOBALS['tf']) ? 'User: '.$GLOBALS['tf']->session->account_id."<br>\n" : ''); |
259 | - $email .= '<br><br>Request Variables:<br>'.print_r($_REQUEST, TRUE); |
|
260 | - $email .= '<br><br>Server Variables:<br>'.print_r($_SERVER, TRUE); |
|
259 | + $email .= '<br><br>Request Variables:<br>'.print_r($_REQUEST, true); |
|
260 | + $email .= '<br><br>Server Variables:<br>'.print_r($_SERVER, true); |
|
261 | 261 | $subject = $_SERVER['HOSTNAME'].' MySQLi Error'; |
262 | 262 | $headers = ''; |
263 | 263 | $headers .= 'MIME-Version: 1.0'.PHP_EOL; |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | } |
271 | 271 | } |
272 | 272 | $this->haltOnError = $haltPrev; |
273 | - if (null === $this->queryId || $this->queryId === FALSE) |
|
273 | + if (null === $this->queryId || $this->queryId === false) |
|
274 | 274 | $this->halt('', $line, $file); |
275 | 275 | |
276 | 276 | // Will return nada if it fails. That's fine. |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | * @return bool |
295 | 295 | */ |
296 | 296 | public function next_record($resultType = MYSQLI_BOTH) { |
297 | - if ($this->queryId === FALSE) { |
|
297 | + if ($this->queryId === false) { |
|
298 | 298 | $this->halt('next_record called with no query pending.'); |
299 | 299 | return 0; |
300 | 300 | } |
@@ -422,11 +422,11 @@ discard block |
||
422 | 422 | * @param bool $haltOnError optional, defaults to TRUE, whether or not to halt on error |
423 | 423 | * @return bool|int|\mysqli_result |
424 | 424 | */ |
425 | - public function unlock($haltOnError = TRUE) { |
|
425 | + public function unlock($haltOnError = true) { |
|
426 | 426 | $this->connect(); |
427 | 427 | |
428 | 428 | $res = @mysqli_query($this->linkId, 'unlock tables'); |
429 | - if ($haltOnError === TRUE && !$res) { |
|
429 | + if ($haltOnError === true && !$res) { |
|
430 | 430 | $this->halt('unlock() failed.'); |
431 | 431 | return 0; |
432 | 432 | } |
@@ -515,9 +515,9 @@ discard block |
||
515 | 515 | * @return bool |
516 | 516 | */ |
517 | 517 | function mysqli_result($result, $row, $field = 0) { |
518 | - if ($result === false) return FALSE; |
|
519 | - if ($row >= mysqli_num_rows($result)) return FALSE; |
|
520 | - if (is_string($field) && !(mb_strpos($field, '.') === FALSE)) { |
|
518 | + if ($result === false) return false; |
|
519 | + if ($row >= mysqli_num_rows($result)) return false; |
|
520 | + if (is_string($field) && !(mb_strpos($field, '.') === false)) { |
|
521 | 521 | $tField = explode('.', $field); |
522 | 522 | $field = -1; |
523 | 523 | $tFields = mysqli_fetch_fields($result); |
@@ -527,7 +527,7 @@ discard block |
||
527 | 527 | break; |
528 | 528 | } |
529 | 529 | } |
530 | - if ($field == -1) return FALSE; |
|
530 | + if ($field == -1) return false; |
|
531 | 531 | } |
532 | 532 | mysqli_data_seek($result, $row); |
533 | 533 | $line = mysqli_fetch_array($result); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | $dSN = "$driver:dbname=$database;host=$host"; |
76 | 76 | if ($this->characterSet != '') |
77 | 77 | $dSN .= ';charset='.$this->characterSet; |
78 | - if ($this->linkId === FALSE) { |
|
78 | + if ($this->linkId === false) { |
|
79 | 79 | try |
80 | 80 | { |
81 | 81 | $this->linkId = new \PDO($dSN, $user, $password); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | public function queryReturn($query, $line = '', $file = '') { |
139 | 139 | $this->query($query, $line, $file); |
140 | 140 | if ($this->num_rows() == 0) { |
141 | - return FALSE; |
|
141 | + return false; |
|
142 | 142 | } elseif ($this->num_rows() == 1) { |
143 | 143 | $this->next_record(MYSQL_ASSOC); |
144 | 144 | return $this->Record; |
@@ -187,12 +187,12 @@ discard block |
||
187 | 187 | /* we already complained in connect() about that. */ |
188 | 188 | } |
189 | 189 | // New query, discard previous result. |
190 | - if ($this->queryId !== FALSE) |
|
190 | + if ($this->queryId !== false) |
|
191 | 191 | $this->free(); |
192 | 192 | |
193 | 193 | if ($this->Debug) |
194 | 194 | printf("Debug: query = %s<br>\n", $queryString); |
195 | - if (isset($GLOBALS['log_queries']) && $GLOBALS['log_queries'] !== FALSE) |
|
195 | + if (isset($GLOBALS['log_queries']) && $GLOBALS['log_queries'] !== false) |
|
196 | 196 | $this->log($queryString, $line, $file); |
197 | 197 | |
198 | 198 | $this->queryId = $this->linkId->prepare($queryString); |
@@ -200,8 +200,8 @@ discard block |
||
200 | 200 | $this->Rows = $this->queryId->fetchAll(); |
201 | 201 | $this->log("PDO Query $queryString (S:$success) - ".count($this->Rows).' Rows', __LINE__, __FILE__); |
202 | 202 | $this->Row = 0; |
203 | - if ($success === FALSE) { |
|
204 | - $email = "MySQL Error<br>\n".'Query: '.$queryString."<br>\n".'Error #'.print_r($this->queryId->errorInfo(), TRUE)."<br>\n".'Line: '.$line."<br>\n".'File: '.$file."<br>\n".(isset($GLOBALS['tf']) ? 'User: '.$GLOBALS['tf']->session->account_id."<br>\n" : ''); |
|
203 | + if ($success === false) { |
|
204 | + $email = "MySQL Error<br>\n".'Query: '.$queryString."<br>\n".'Error #'.print_r($this->queryId->errorInfo(), true)."<br>\n".'Line: '.$line."<br>\n".'File: '.$file."<br>\n".(isset($GLOBALS['tf']) ? 'User: '.$GLOBALS['tf']->session->account_id."<br>\n" : ''); |
|
205 | 205 | |
206 | 206 | $email .= '<br><br>Request Variables:<br>'; |
207 | 207 | foreach ($_REQUEST as $key => $value) |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $headers .= 'Content-type: text/html; charset=UTF-8'.PHP_EOL; |
217 | 217 | $headers .= 'From: No-Reply <[email protected]>'.PHP_EOL; |
218 | 218 | $headers .= 'X-Mailer: Trouble-Free.Net Admin Center'.PHP_EOL; |
219 | - admin_mail($subject, $email, $headers, FALSE, 'admin/sql_error.tpl'); |
|
219 | + admin_mail($subject, $email, $headers, false, 'admin/sql_error.tpl'); |
|
220 | 220 | $this->halt('Invalid SQL: '.$queryString, $line, $file); |
221 | 221 | } |
222 | 222 |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | public $password = ''; |
25 | 25 | public $database = 'pdns'; |
26 | 26 | public $type = 'mdb2'; |
27 | - public $error = FALSE; |
|
27 | + public $error = false; |
|
28 | 28 | public $message = ''; |
29 | 29 | |
30 | 30 | /** |
@@ -220,7 +220,7 @@ discard block |
||
220 | 220 | public function queryReturn($query, $line = '', $file = '') { |
221 | 221 | $this->query($query, $line, $file); |
222 | 222 | if ($this->num_rows() == 0) { |
223 | - return FALSE; |
|
223 | + return false; |
|
224 | 224 | } elseif ($this->num_rows() == 1) { |
225 | 225 | $this->next_record(MYSQL_ASSOC); |
226 | 226 | return $this->Record; |
@@ -275,7 +275,7 @@ discard block |
||
275 | 275 | $this->free(); |
276 | 276 | if ($this->Debug) |
277 | 277 | printf("Debug: query = %s<br>\n", $queryString); |
278 | - if (isset($GLOBALS['log_queries']) && $GLOBALS['log_queries'] !== FALSE) |
|
278 | + if (isset($GLOBALS['log_queries']) && $GLOBALS['log_queries'] !== false) |
|
279 | 279 | $this->log($queryString, $line, $file); |
280 | 280 | $tries = 3; |
281 | 281 | $try = 1; |
@@ -283,27 +283,27 @@ discard block |
||
283 | 283 | $this->Row = 0; |
284 | 284 | $this->Errno = @mysqli_errno($this->linkId); |
285 | 285 | $this->Error = @mysqli_error($this->linkId); |
286 | - while ($this->queryId === FALSE && $try <= $tries) { |
|
286 | + while ($this->queryId === false && $try <= $tries) { |
|
287 | 287 | $this->message = 'MySQL error '.@mysqli_errno($this->linkId).': '.@mysqli_error($this->linkId).' Query: '.$this->query; |
288 | - $this->error = TRUE; |
|
288 | + $this->error = true; |
|
289 | 289 | @mysqli_close($this->linkId); |
290 | 290 | $this->connect(); |
291 | 291 | $try++; |
292 | 292 | } |
293 | 293 | $this->haltOnError = $haltPrev; |
294 | - if ($this->queryId === FALSE) { |
|
294 | + if ($this->queryId === false) { |
|
295 | 295 | $email = "MySQLi Error<br>\n".'Query: '.$queryString."<br>\n".'Error #'.$this->Errno.': '.$this->Error."<br>\n".'Line: '.$line."<br>\n".'File: '.$file."<br>\n".(isset($GLOBALS['tf']) ? |
296 | 296 | 'User: '.$GLOBALS['tf']->session->account_id."<br>\n" : ''); |
297 | 297 | |
298 | - $email .= '<br><br>Request Variables:<br>'.print_r($_REQUEST, TRUE); |
|
299 | - $email .= '<br><br>Server Variables:<br>'.print_r($_SERVER, TRUE); |
|
298 | + $email .= '<br><br>Request Variables:<br>'.print_r($_REQUEST, true); |
|
299 | + $email .= '<br><br>Server Variables:<br>'.print_r($_SERVER, true); |
|
300 | 300 | $subject = $_SERVER['HOSTNAME'].' MySQLi Error'; |
301 | 301 | $headers = ''; |
302 | 302 | $headers .= 'MIME-Version: 1.0'.PHP_EOL; |
303 | 303 | $headers .= 'Content-type: text/html; charset=UTF-8'.PHP_EOL; |
304 | 304 | $headers .= 'From: No-Reply <[email protected]>'.PHP_EOL; |
305 | 305 | $headers .= 'X-Mailer: Trouble-Free.Net Admin Center'.PHP_EOL; |
306 | - admin_mail($subject, $email, $headers, FALSE, 'admin/sql_error.tpl'); |
|
306 | + admin_mail($subject, $email, $headers, false, 'admin/sql_error.tpl'); |
|
307 | 307 | $this->halt('Invalid SQL: '.$queryString, $line, $file); |
308 | 308 | } |
309 | 309 | |
@@ -320,7 +320,7 @@ discard block |
||
320 | 320 | * @return bool |
321 | 321 | */ |
322 | 322 | public function next_record($resultType = MYSQLI_BOTH) { |
323 | - if ($this->queryId === FALSE) { |
|
323 | + if ($this->queryId === false) { |
|
324 | 324 | $this->halt('next_record called with no query pending.'); |
325 | 325 | return 0; |
326 | 326 | } |
@@ -365,7 +365,7 @@ discard block |
||
365 | 365 | * @return bool |
366 | 366 | */ |
367 | 367 | public function transactionBegin() { |
368 | - return TRUE; |
|
368 | + return true; |
|
369 | 369 | } |
370 | 370 | |
371 | 371 | /** |
@@ -373,7 +373,7 @@ discard block |
||
373 | 373 | * @return bool |
374 | 374 | */ |
375 | 375 | public function transactionCommit() { |
376 | - return TRUE; |
|
376 | + return true; |
|
377 | 377 | } |
378 | 378 | |
379 | 379 | /** |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | * @return bool |
382 | 382 | */ |
383 | 383 | public function transactionAbort() { |
384 | - return TRUE; |
|
384 | + return true; |
|
385 | 385 | } |
386 | 386 | |
387 | 387 | /** |
@@ -17,8 +17,7 @@ discard block |
||
17 | 17 | * |
18 | 18 | * @access public |
19 | 19 | */ |
20 | -class Db extends Generic implements Db_Interface |
|
21 | -{ |
|
20 | +class Db extends Generic implements Db_Interface { |
|
22 | 21 | public $driver = 'mysql'; |
23 | 22 | public $Rows = []; |
24 | 23 | public $type = 'adodb'; |
@@ -172,11 +171,9 @@ discard block |
||
172 | 171 | |
173 | 172 | } |
174 | 173 | |
175 | - try |
|
176 | - { |
|
174 | + try { |
|
177 | 175 | $this->queryId = $this->linkId->Execute($queryString); |
178 | - } |
|
179 | - catch (exception $e) { |
|
176 | + } catch (exception $e) { |
|
180 | 177 | $email = "MySQL Error<br>\n".'Query: '.$queryString."<br>\n".'Error #'.print_r($e, TRUE)."<br>\n".'Line: '.$line."<br>\n".'File: '.$file."<br>\n".(isset($GLOBALS['tf']) ? |
181 | 178 | 'User: '.$GLOBALS['tf']->session->account_id."<br>\n" : ''); |
182 | 179 |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | if ('' == $driver) |
46 | 46 | $driver = $this->driver; |
47 | 47 | /* establish connection, select database */ |
48 | - if ($this->linkId === FALSE) { |
|
48 | + if ($this->linkId === false) { |
|
49 | 49 | $this->linkId = NewADOConnection($driver); |
50 | 50 | $this->linkId->Connect($host, $user, $password, $database); |
51 | 51 | } |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | public function queryReturn($query, $line = '', $file = '') { |
113 | 113 | $this->query($query, $line, $file); |
114 | 114 | if ($this->num_rows() == 0) { |
115 | - return FALSE; |
|
115 | + return false; |
|
116 | 116 | } elseif ($this->num_rows() == 1) { |
117 | 117 | $this->next_record(MYSQL_ASSOC); |
118 | 118 | return $this->Record; |
@@ -162,12 +162,12 @@ discard block |
||
162 | 162 | } |
163 | 163 | |
164 | 164 | // New query, discard previous result. |
165 | - if ($this->queryId !== FALSE) |
|
165 | + if ($this->queryId !== false) |
|
166 | 166 | $this->free(); |
167 | 167 | |
168 | 168 | if ($this->Debug) |
169 | 169 | printf("Debug: query = %s<br>\n", $queryString); |
170 | - if ($GLOBALS['log_queries'] !== FALSE) { |
|
170 | + if ($GLOBALS['log_queries'] !== false) { |
|
171 | 171 | $this->log($queryString, $line, $file); |
172 | 172 | |
173 | 173 | } |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $this->queryId = $this->linkId->Execute($queryString); |
178 | 178 | } |
179 | 179 | catch (exception $e) { |
180 | - $email = "MySQL Error<br>\n".'Query: '.$queryString."<br>\n".'Error #'.print_r($e, TRUE)."<br>\n".'Line: '.$line."<br>\n".'File: '.$file."<br>\n".(isset($GLOBALS['tf']) ? |
|
180 | + $email = "MySQL Error<br>\n".'Query: '.$queryString."<br>\n".'Error #'.print_r($e, true)."<br>\n".'Line: '.$line."<br>\n".'File: '.$file."<br>\n".(isset($GLOBALS['tf']) ? |
|
181 | 181 | 'User: '.$GLOBALS['tf']->session->account_id."<br>\n" : ''); |
182 | 182 | |
183 | 183 | $email .= '<br><br>Request Variables:<br>'; |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | $headers .= 'Content-type: text/html; charset=UTF-8'.PHP_EOL; |
194 | 194 | $headers .= 'From: No-Reply <[email protected]>'.PHP_EOL; |
195 | 195 | $headers .= 'X-Mailer: Trouble-Free.Net Admin Center'.PHP_EOL; |
196 | - admin_mail($subject, $email, $headers, FALSE, 'admin/sql_error.tpl'); |
|
196 | + admin_mail($subject, $email, $headers, false, 'admin/sql_error.tpl'); |
|
197 | 197 | $this->halt('Invalid SQL: '.$queryString, $line, $file); |
198 | 198 | } |
199 | 199 | $this->log("ADOdb Query $queryString (S:$success) - ".count($this->Rows).' Rows', __LINE__, __FILE__); |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | * @return bool |
248 | 248 | */ |
249 | 249 | public function transactionBegin() { |
250 | - return TRUE; |
|
250 | + return true; |
|
251 | 251 | } |
252 | 252 | |
253 | 253 | /** |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | * @return bool |
256 | 256 | */ |
257 | 257 | public function transactionCommit() { |
258 | - return TRUE; |
|
258 | + return true; |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | /** |
@@ -263,7 +263,7 @@ discard block |
||
263 | 263 | * @return bool |
264 | 264 | */ |
265 | 265 | public function transactionAbort() { |
266 | - return TRUE; |
|
266 | + return true; |
|
267 | 267 | } |
268 | 268 | |
269 | 269 | /** |