@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | public $password = ''; |
22 | 22 | |
23 | 23 | /* public: configuration parameters */ |
24 | - public $autoStripslashes = FALSE; |
|
24 | + public $autoStripslashes = false; |
|
25 | 25 | public $Debug = 0; // Set to 1 for debugging messages. |
26 | 26 | public $haltOnError = 'yes'; // "yes" (halt with message), "no" (ignore errors quietly), "report" (ignore error, but spit a warning) |
27 | 27 | |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $time = $timestamp; |
153 | 153 | else { |
154 | 154 | $this->log('Cannot Match Timestamp from '.$timestamp, __LINE__, __FILE__); |
155 | - $time = FALSE; |
|
155 | + $time = false; |
|
156 | 156 | } |
157 | 157 | return $time; |
158 | 158 | } |
@@ -23,7 +23,7 @@ |
||
23 | 23 | public $password = ''; |
24 | 24 | |
25 | 25 | /* public: configuration parameters */ |
26 | - public $autoStripslashes = FALSE; |
|
26 | + public $autoStripslashes = false; |
|
27 | 27 | public $Debug = 0; // Set to 1 for debugging messages. |
28 | 28 | public $haltOnError = 'yes'; // "yes" (halt with message), "no" (ignore errors quietly), "report" (ignore error, but spit a warning) |
29 | 29 |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | public function queryReturn($query, $line = '', $file = '') { |
116 | 116 | $this->query($query, $line, $file); |
117 | 117 | if ($this->num_rows() == 0) { |
118 | - return FALSE; |
|
118 | + return false; |
|
119 | 119 | } elseif ($this->num_rows() == 1) { |
120 | 120 | $this->next_record(MYSQL_ASSOC); |
121 | 121 | return $this->Record; |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | if (!$this->Errno) { |
237 | 237 | return pg_exec($this->linkId, 'commit'); |
238 | 238 | } else { |
239 | - return FALSE; |
|
239 | + return false; |
|
240 | 240 | } |
241 | 241 | } |
242 | 242 |
@@ -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); |
@@ -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 | /** |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | $dSN = "$driver:dbname=$database;host=$host"; |
75 | 75 | if ($this->characterSet != '') |
76 | 76 | $dSN .= ';charset='.$this->characterSet; |
77 | - if ($this->linkId === FALSE) { |
|
77 | + if ($this->linkId === false) { |
|
78 | 78 | try { |
79 | 79 | $this->linkId = new \PDO($dSN, $user, $password); |
80 | 80 | } catch (\PDOException $e) { |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | public function queryReturn($query, $line = '', $file = '') { |
136 | 136 | $this->query($query, $line, $file); |
137 | 137 | if ($this->num_rows() == 0) { |
138 | - return FALSE; |
|
138 | + return false; |
|
139 | 139 | } elseif ($this->num_rows() == 1) { |
140 | 140 | $this->next_record(MYSQL_ASSOC); |
141 | 141 | return $this->Record; |
@@ -184,12 +184,12 @@ discard block |
||
184 | 184 | /* we already complained in connect() about that. */ |
185 | 185 | } |
186 | 186 | // New query, discard previous result. |
187 | - if ($this->queryId !== FALSE) |
|
187 | + if ($this->queryId !== false) |
|
188 | 188 | $this->free(); |
189 | 189 | |
190 | 190 | if ($this->Debug) |
191 | 191 | printf("Debug: query = %s<br>\n", $queryString); |
192 | - if (isset($GLOBALS['log_queries']) && $GLOBALS['log_queries'] !== FALSE) |
|
192 | + if (isset($GLOBALS['log_queries']) && $GLOBALS['log_queries'] !== false) |
|
193 | 193 | $this->log($queryString, $line, $file); |
194 | 194 | |
195 | 195 | $this->queryId = $this->linkId->prepare($queryString); |
@@ -197,8 +197,8 @@ discard block |
||
197 | 197 | $this->Rows = $this->queryId->fetchAll(); |
198 | 198 | $this->log("PDO Query $queryString (S:$success) - ".count($this->Rows).' Rows', __LINE__, __FILE__); |
199 | 199 | $this->Row = 0; |
200 | - if ($success === FALSE) { |
|
201 | - $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" : ''); |
|
200 | + if ($success === false) { |
|
201 | + $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" : ''); |
|
202 | 202 | |
203 | 203 | $email .= '<br><br>Request Variables:<br>'; |
204 | 204 | foreach ($_REQUEST as $key => $value) |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | $headers .= 'Content-type: text/html; charset=UTF-8'.PHP_EOL; |
214 | 214 | $headers .= 'From: No-Reply <[email protected]>'.PHP_EOL; |
215 | 215 | $headers .= 'X-Mailer: Trouble-Free.Net Admin Center'.PHP_EOL; |
216 | - admin_mail($subject, $email, $headers, FALSE, 'admin/sql_error.tpl'); |
|
216 | + admin_mail($subject, $email, $headers, false, 'admin/sql_error.tpl'); |
|
217 | 217 | $this->halt('Invalid SQL: '.$queryString, $line, $file); |
218 | 218 | } |
219 | 219 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | if ('' == $driver) |
45 | 45 | $driver = $this->driver; |
46 | 46 | /* establish connection, select database */ |
47 | - if ($this->linkId === FALSE) { |
|
47 | + if ($this->linkId === false) { |
|
48 | 48 | $this->linkId = NewADOConnection($driver); |
49 | 49 | $this->linkId->Connect($host, $user, $password, $database); |
50 | 50 | } |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | public function queryReturn($query, $line = '', $file = '') { |
112 | 112 | $this->query($query, $line, $file); |
113 | 113 | if ($this->num_rows() == 0) { |
114 | - return FALSE; |
|
114 | + return false; |
|
115 | 115 | } elseif ($this->num_rows() == 1) { |
116 | 116 | $this->next_record(MYSQL_ASSOC); |
117 | 117 | return $this->Record; |
@@ -161,12 +161,12 @@ discard block |
||
161 | 161 | } |
162 | 162 | |
163 | 163 | // New query, discard previous result. |
164 | - if ($this->queryId !== FALSE) |
|
164 | + if ($this->queryId !== false) |
|
165 | 165 | $this->free(); |
166 | 166 | |
167 | 167 | if ($this->Debug) |
168 | 168 | printf("Debug: query = %s<br>\n", $queryString); |
169 | - if ($GLOBALS['log_queries'] !== FALSE) { |
|
169 | + if ($GLOBALS['log_queries'] !== false) { |
|
170 | 170 | $this->log($queryString, $line, $file); |
171 | 171 | |
172 | 172 | } |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | try { |
175 | 175 | $this->queryId = $this->linkId->Execute($queryString); |
176 | 176 | } catch (exception $e) { |
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']) ? |
|
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']) ? |
|
178 | 178 | 'User: '.$GLOBALS['tf']->session->account_id."<br>\n" : ''); |
179 | 179 | |
180 | 180 | $email .= '<br><br>Request Variables:<br>'; |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | $headers .= 'Content-type: text/html; charset=UTF-8'.PHP_EOL; |
191 | 191 | $headers .= 'From: No-Reply <[email protected]>'.PHP_EOL; |
192 | 192 | $headers .= 'X-Mailer: Trouble-Free.Net Admin Center'.PHP_EOL; |
193 | - admin_mail($subject, $email, $headers, FALSE, 'admin/sql_error.tpl'); |
|
193 | + admin_mail($subject, $email, $headers, false, 'admin/sql_error.tpl'); |
|
194 | 194 | $this->halt('Invalid SQL: '.$queryString, $line, $file); |
195 | 195 | } |
196 | 196 | $this->log("ADOdb Query $queryString (S:$success) - ".count($this->Rows).' Rows', __LINE__, __FILE__); |
@@ -244,7 +244,7 @@ discard block |
||
244 | 244 | * @return bool |
245 | 245 | */ |
246 | 246 | public function transactionBegin() { |
247 | - return TRUE; |
|
247 | + return true; |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | /** |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | * @return bool |
253 | 253 | */ |
254 | 254 | public function transactionCommit() { |
255 | - return TRUE; |
|
255 | + return true; |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | /** |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | * @return bool |
261 | 261 | */ |
262 | 262 | public function transactionAbort() { |
263 | - return TRUE; |
|
263 | + return true; |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | /** |