@@ -88,8 +88,7 @@ |
||
| 88 | 88 | return ( ! $this->password) |
| 89 | 89 | ? new SQLite3($this->database) |
| 90 | 90 | : new SQLite3($this->database, SQLITE3_OPEN_READWRITE | SQLITE3_OPEN_CREATE, $this->password); |
| 91 | - } |
|
| 92 | - catch (Exception $e) |
|
| 91 | + } catch (Exception $e) |
|
| 93 | 92 | { |
| 94 | 93 | return FALSE; |
| 95 | 94 | } |
@@ -112,8 +112,7 @@ |
||
| 112 | 112 | if ( ! @unlink($this->db->database)) |
| 113 | 113 | { |
| 114 | 114 | return $this->db->db_debug ? $this->db->display_error('db_unable_to_drop') : FALSE; |
| 115 | - } |
|
| 116 | - elseif ( ! empty($this->db->data_cache['db_names'])) |
|
| 115 | + } elseif ( ! empty($this->db->data_cache['db_names'])) |
|
| 117 | 116 | { |
| 118 | 117 | $key = array_search(strtolower($this->db->database), array_map('strtolower', $this->db->data_cache['db_names']), TRUE); |
| 119 | 118 | if ($key !== FALSE) |
@@ -158,8 +158,7 @@ |
||
| 158 | 158 | if (($row = $this->result_id->fetchArray(SQLITE3_ASSOC)) === FALSE) |
| 159 | 159 | { |
| 160 | 160 | return FALSE; |
| 161 | - } |
|
| 162 | - elseif ($class_name === 'stdClass') |
|
| 161 | + } elseif ($class_name === 'stdClass') |
|
| 163 | 162 | { |
| 164 | 163 | return (object) $row; |
| 165 | 164 | } |
@@ -375,8 +375,7 @@ discard block |
||
| 375 | 375 | if (isset($sqlsrv_error['SQLSTATE'])) |
| 376 | 376 | { |
| 377 | 377 | $error['code'] = isset($sqlsrv_error['code']) ? $sqlsrv_error['SQLSTATE'].'/'.$sqlsrv_error['code'] : $sqlsrv_error['SQLSTATE']; |
| 378 | - } |
|
| 379 | - elseif (isset($sqlsrv_error['code'])) |
|
| 378 | + } elseif (isset($sqlsrv_error['code'])) |
|
| 380 | 379 | { |
| 381 | 380 | $error['code'] = $sqlsrv_error['code']; |
| 382 | 381 | } |
@@ -480,8 +479,7 @@ discard block |
||
| 480 | 479 | if (count($this->qb_select) === 0) |
| 481 | 480 | { |
| 482 | 481 | $select = '*'; // Inevitable |
| 483 | - } |
|
| 484 | - else |
|
| 482 | + } else |
|
| 485 | 483 | { |
| 486 | 484 | // Use only field names and their aliases, everything else is out of our scope. |
| 487 | 485 | $select = array(); |
@@ -87,8 +87,7 @@ discard block |
||
| 87 | 87 | if ( ! is_array($data) && empty($$key)) |
| 88 | 88 | { |
| 89 | 89 | $$key = $val; |
| 90 | - } |
|
| 91 | - else |
|
| 90 | + } else |
|
| 92 | 91 | { |
| 93 | 92 | $$key = isset($data[$key]) ? $data[$key] : $val; |
| 94 | 93 | } |
@@ -137,8 +136,7 @@ discard block |
||
| 137 | 136 | { |
| 138 | 137 | $word .= $pool[random_int(0, $rand_max)]; |
| 139 | 138 | } |
| 140 | - } |
|
| 141 | - catch (Exception $e) |
|
| 139 | + } catch (Exception $e) |
|
| 142 | 140 | { |
| 143 | 141 | // This means fallback to the next possible |
| 144 | 142 | // alternative to random_int() |
@@ -215,8 +213,7 @@ discard block |
||
| 215 | 213 | { |
| 216 | 214 | $word .= $pool[mt_rand(0, $rand_max)]; |
| 217 | 215 | } |
| 218 | - } |
|
| 219 | - elseif ( ! is_string($word)) |
|
| 216 | + } elseif ( ! is_string($word)) |
|
| 220 | 217 | { |
| 221 | 218 | $word = (string) $word; |
| 222 | 219 | } |
@@ -284,8 +281,7 @@ discard block |
||
| 284 | 281 | ($font_size > 5) && $font_size = 5; |
| 285 | 282 | $x = mt_rand(0, $img_width / ($length / 3)); |
| 286 | 283 | $y = 0; |
| 287 | - } |
|
| 288 | - else |
|
| 284 | + } else |
|
| 289 | 285 | { |
| 290 | 286 | ($font_size > 30) && $font_size = 30; |
| 291 | 287 | $x = mt_rand(0, $img_width / ($length / 1.5)); |
@@ -299,8 +295,7 @@ discard block |
||
| 299 | 295 | $y = mt_rand(0 , $img_height / 2); |
| 300 | 296 | imagestring($im, $font_size, $x, $y, $word[$i], $colors['text']); |
| 301 | 297 | $x += ($font_size * 2); |
| 302 | - } |
|
| 303 | - else |
|
| 298 | + } else |
|
| 304 | 299 | { |
| 305 | 300 | $y = mt_rand($img_height / 2, $img_height - 3); |
| 306 | 301 | imagettftext($im, $font_size, $angle, $x, $y, $colors['text'], $font_path, $word[$i]); |
@@ -320,13 +315,11 @@ discard block |
||
| 320 | 315 | { |
| 321 | 316 | $img_filename = $now.'.jpg'; |
| 322 | 317 | imagejpeg($im, $img_path.$img_filename); |
| 323 | - } |
|
| 324 | - elseif (function_exists('imagepng')) |
|
| 318 | + } elseif (function_exists('imagepng')) |
|
| 325 | 319 | { |
| 326 | 320 | $img_filename = $now.'.png'; |
| 327 | 321 | imagepng($im, $img_path.$img_filename); |
| 328 | - } |
|
| 329 | - else |
|
| 322 | + } else |
|
| 330 | 323 | { |
| 331 | 324 | return FALSE; |
| 332 | 325 | } |
@@ -104,8 +104,7 @@ discard block |
||
| 104 | 104 | if ($datestr === '') |
| 105 | 105 | { |
| 106 | 106 | return ''; |
| 107 | - } |
|
| 108 | - elseif (empty($time)) |
|
| 107 | + } elseif (empty($time)) |
|
| 109 | 108 | { |
| 110 | 109 | $time = now(); |
| 111 | 110 | } |
@@ -283,8 +282,7 @@ discard block |
||
| 283 | 282 | if ($month < 1 OR $month > 12) |
| 284 | 283 | { |
| 285 | 284 | return 0; |
| 286 | - } |
|
| 287 | - elseif ( ! is_numeric($year) OR strlen($year) !== 4) |
|
| 285 | + } elseif ( ! is_numeric($year) OR strlen($year) !== 4) |
|
| 288 | 286 | { |
| 289 | 287 | $year = date('Y'); |
| 290 | 288 | } |
@@ -420,8 +418,7 @@ discard block |
||
| 420 | 418 | if ($fmt === 'us') |
| 421 | 419 | { |
| 422 | 420 | $r .= date('h', $time).':'.date('i', $time); |
| 423 | - } |
|
| 424 | - else |
|
| 421 | + } else |
|
| 425 | 422 | { |
| 426 | 423 | $r .= date('H', $time).':'.date('i', $time); |
| 427 | 424 | } |
@@ -477,8 +474,7 @@ discard block |
||
| 477 | 474 | if ($ampm[0] === 'p' && $hour < 12) |
| 478 | 475 | { |
| 479 | 476 | $hour += 12; |
| 480 | - } |
|
| 481 | - elseif ($ampm[0] === 'a' && $hour === 12) |
|
| 477 | + } elseif ($ampm[0] === 'a' && $hour === 12) |
|
| 482 | 478 | { |
| 483 | 479 | $hour = 0; |
| 484 | 480 | } |
@@ -505,8 +501,7 @@ discard block |
||
| 505 | 501 | if (empty($bad_date)) |
| 506 | 502 | { |
| 507 | 503 | return 'Unknown'; |
| 508 | - } |
|
| 509 | - elseif (empty($format)) |
|
| 504 | + } elseif (empty($format)) |
|
| 510 | 505 | { |
| 511 | 506 | $format = 'U'; |
| 512 | 507 | } |
@@ -518,8 +513,7 @@ discard block |
||
| 518 | 513 | { |
| 519 | 514 | $year = substr($bad_date, 0, 4); |
| 520 | 515 | $month = substr($bad_date, 4, 2); |
| 521 | - } |
|
| 522 | - else |
|
| 516 | + } else |
|
| 523 | 517 | { |
| 524 | 518 | $month = substr($bad_date, 0, 2); |
| 525 | 519 | $year = substr($bad_date, 2, 4); |
@@ -732,8 +726,7 @@ discard block |
||
| 732 | 726 | { |
| 733 | 727 | $arg = new DateTime(); |
| 734 | 728 | $arg->setTimestamp($mixed); |
| 735 | - } |
|
| 736 | - else |
|
| 729 | + } else |
|
| 737 | 730 | { |
| 738 | 731 | $arg = (int) $mixed; |
| 739 | 732 | } |
@@ -764,23 +757,23 @@ discard block |
||
| 764 | 757 | $arg = new DateTime(); |
| 765 | 758 | $arg->setDate(date('Y', $mixed), date('n', $mixed), date('j', $mixed)); |
| 766 | 759 | $arg->setTime(date('G', $mixed), date('i', $mixed), date('s', $mixed)); |
| 767 | - } |
|
| 768 | - else |
|
| 760 | + } else |
|
| 769 | 761 | { |
| 770 | 762 | $arg = (int) $mixed; |
| 771 | 763 | } |
| 772 | 764 | $range[] = $from->format($format); |
| 773 | 765 | |
| 774 | - if (is_int($arg)) // Day intervals |
|
| 766 | + if (is_int($arg)) { |
|
| 767 | + // Day intervals |
|
| 775 | 768 | { |
| 776 | 769 | do |
| 777 | 770 | { |
| 778 | 771 | $from->modify('+1 day'); |
| 772 | + } |
|
| 779 | 773 | $range[] = $from->format($format); |
| 780 | 774 | } |
| 781 | 775 | while (--$arg > 0); |
| 782 | - } |
|
| 783 | - else // end date UNIX timestamp |
|
| 776 | + } else // end date UNIX timestamp |
|
| 784 | 777 | { |
| 785 | 778 | for ($from->modify('+1 day'), $end_check = $arg->format('Ymd'); $from->format('Ymd') < $end_check; $from->modify('+1 day')) |
| 786 | 779 | { |
@@ -85,8 +85,7 @@ |
||
| 85 | 85 | if (($directory_depth < 1 OR $new_depth > 0) && is_dir($source_dir.$file)) |
| 86 | 86 | { |
| 87 | 87 | $filedata[$file] = directory_map($source_dir.$file, $new_depth, $hidden); |
| 88 | - } |
|
| 89 | - else |
|
| 88 | + } else |
|
| 90 | 89 | { |
| 91 | 90 | $filedata[] = $file; |
| 92 | 91 | } |
@@ -66,8 +66,7 @@ discard block |
||
| 66 | 66 | if ($filename === '' OR $data === '') |
| 67 | 67 | { |
| 68 | 68 | return; |
| 69 | - } |
|
| 70 | - elseif ($data === NULL) |
|
| 69 | + } elseif ($data === NULL) |
|
| 71 | 70 | { |
| 72 | 71 | if ( ! @is_file($filename) OR ($filesize = @filesize($filename)) === FALSE) |
| 73 | 72 | { |
@@ -77,8 +76,7 @@ discard block |
||
| 77 | 76 | $filepath = $filename; |
| 78 | 77 | $filename = explode('/', str_replace(DIRECTORY_SEPARATOR, '/', $filename)); |
| 79 | 78 | $filename = end($filename); |
| 80 | - } |
|
| 81 | - else |
|
| 79 | + } else |
|
| 82 | 80 | { |
| 83 | 81 | $filesize = strlen($data); |
| 84 | 82 | } |
@@ -141,8 +141,7 @@ discard block |
||
| 141 | 141 | if (is_dir($path.DIRECTORY_SEPARATOR.$filename) && $filename[0] !== '.') |
| 142 | 142 | { |
| 143 | 143 | delete_files($path.DIRECTORY_SEPARATOR.$filename, $del_dir, $htdocs, $_level + 1); |
| 144 | - } |
|
| 145 | - elseif ($htdocs !== TRUE OR ! preg_match('/^(\.htaccess|index\.(html|htm|php)|web\.config)$/i', $filename)) |
|
| 144 | + } elseif ($htdocs !== TRUE OR ! preg_match('/^(\.htaccess|index\.(html|htm|php)|web\.config)$/i', $filename)) |
|
| 146 | 145 | { |
| 147 | 146 | @unlink($path.DIRECTORY_SEPARATOR.$filename); |
| 148 | 147 | } |
@@ -190,8 +189,7 @@ discard block |
||
| 190 | 189 | if (is_dir($source_dir.$file) && $file[0] !== '.') |
| 191 | 190 | { |
| 192 | 191 | get_filenames($source_dir.$file.DIRECTORY_SEPARATOR, $include_path, TRUE); |
| 193 | - } |
|
| 194 | - elseif ($file[0] !== '.') |
|
| 192 | + } elseif ($file[0] !== '.') |
|
| 195 | 193 | { |
| 196 | 194 | $_filedata[] = ($include_path === TRUE) ? $source_dir.$file : $file; |
| 197 | 195 | } |
@@ -242,8 +240,7 @@ discard block |
||
| 242 | 240 | if (is_dir($source_dir.$file) && $file[0] !== '.' && $top_level_only === FALSE) |
| 243 | 241 | { |
| 244 | 242 | get_dir_file_info($source_dir.$file.DIRECTORY_SEPARATOR, $top_level_only, TRUE); |
| 245 | - } |
|
| 246 | - elseif ($file[0] !== '.') |
|
| 243 | + } elseif ($file[0] !== '.') |
|
| 247 | 244 | { |
| 248 | 245 | $_filedata[$file] = get_file_info($source_dir.$file); |
| 249 | 246 | $_filedata[$file]['relative_path'] = $relative_path; |
@@ -382,32 +379,25 @@ discard block |
||
| 382 | 379 | if (($perms & 0xC000) === 0xC000) |
| 383 | 380 | { |
| 384 | 381 | $symbolic = 's'; // Socket |
| 385 | - } |
|
| 386 | - elseif (($perms & 0xA000) === 0xA000) |
|
| 382 | + } elseif (($perms & 0xA000) === 0xA000) |
|
| 387 | 383 | { |
| 388 | 384 | $symbolic = 'l'; // Symbolic Link |
| 389 | - } |
|
| 390 | - elseif (($perms & 0x8000) === 0x8000) |
|
| 385 | + } elseif (($perms & 0x8000) === 0x8000) |
|
| 391 | 386 | { |
| 392 | 387 | $symbolic = '-'; // Regular |
| 393 | - } |
|
| 394 | - elseif (($perms & 0x6000) === 0x6000) |
|
| 388 | + } elseif (($perms & 0x6000) === 0x6000) |
|
| 395 | 389 | { |
| 396 | 390 | $symbolic = 'b'; // Block special |
| 397 | - } |
|
| 398 | - elseif (($perms & 0x4000) === 0x4000) |
|
| 391 | + } elseif (($perms & 0x4000) === 0x4000) |
|
| 399 | 392 | { |
| 400 | 393 | $symbolic = 'd'; // Directory |
| 401 | - } |
|
| 402 | - elseif (($perms & 0x2000) === 0x2000) |
|
| 394 | + } elseif (($perms & 0x2000) === 0x2000) |
|
| 403 | 395 | { |
| 404 | 396 | $symbolic = 'c'; // Character special |
| 405 | - } |
|
| 406 | - elseif (($perms & 0x1000) === 0x1000) |
|
| 397 | + } elseif (($perms & 0x1000) === 0x1000) |
|
| 407 | 398 | { |
| 408 | 399 | $symbolic = 'p'; // FIFO pipe |
| 409 | - } |
|
| 410 | - else |
|
| 400 | + } else |
|
| 411 | 401 | { |
| 412 | 402 | $symbolic = 'u'; // Unknown |
| 413 | 403 | } |