@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | $this->log(sprintf(__("Excluding table %s.%s from backup"), $table, $database)); |
| 280 | 280 | } |
| 281 | 281 | $inc++; |
| 282 | - } |
|
| 282 | + } |
|
| 283 | 283 | |
| 284 | 284 | return $tablesList; |
| 285 | 285 | |
@@ -503,7 +503,7 @@ discard block |
||
| 503 | 503 | $buffer = ""; |
| 504 | 504 | $this->countRecords++; |
| 505 | 505 | |
| 506 | - foreach ($arr as $key => $value) { |
|
| 506 | + foreach ($arr as $key => $value) { |
|
| 507 | 507 | $value = $this->_real_escape($value); |
| 508 | 508 | $buffer .= "'".$value."', "; |
| 509 | 509 | } |
@@ -529,8 +529,8 @@ discard block |
||
| 529 | 529 | $line = ("\n#\n# Table structure for table `$tableName`\n#\n\n"); |
| 530 | 530 | $this->fs->get_tmp_filesystem_append()->write($dumpfile, $line); |
| 531 | 531 | |
| 532 | - if ($this->dbDropSyntax) |
|
| 533 | - { |
|
| 532 | + if ($this->dbDropSyntax) |
|
| 533 | + { |
|
| 534 | 534 | $line = ("\nDROP table IF EXISTS `$tableName`;\n"); |
| 535 | 535 | $this->fs->get_tmp_filesystem_append()->write($dumpfile, $line); |
| 536 | 536 | } |
@@ -147,14 +147,14 @@ |
||
| 147 | 147 | $unit_list = array('B', 'KB', 'MB', 'GB', 'PB'); |
| 148 | 148 | |
| 149 | 149 | if ($bytes == 0) { |
| 150 | - return $bytes . ' ' . $unit_list[0]; |
|
| 150 | + return $bytes . ' ' . $unit_list[0]; |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | $unit_count = count($unit_list); |
| 154 | 154 | for ($i = $unit_count - 1; $i >= 0; $i--) { |
| 155 | - $power = $i * 10; |
|
| 156 | - if (($bytes >> $power) >= 1) |
|
| 157 | - return round($bytes / (1 << $power), $decimals) . ' ' . $unit_list[$i]; |
|
| 155 | + $power = $i * 10; |
|
| 156 | + if (($bytes >> $power) >= 1) |
|
| 157 | + return round($bytes / (1 << $power), $decimals) . ' ' . $unit_list[$i]; |
|
| 158 | 158 | } |
| 159 | 159 | } |
| 160 | 160 | } |
@@ -555,15 +555,15 @@ discard block |
||
| 555 | 555 | return array($bytes_wrote, $last_position); |
| 556 | 556 | } |
| 557 | 557 | |
| 558 | - /** |
|
| 559 | - * Open a TAR archive and put the file cursor at the end for data appending |
|
| 560 | - * |
|
| 561 | - * If $file is empty, the tar file will be created in memory |
|
| 562 | - * |
|
| 563 | - * @param string $file |
|
| 564 | - * @throws ArchiveIOException |
|
| 565 | - */ |
|
| 566 | - /* |
|
| 558 | + /** |
|
| 559 | + * Open a TAR archive and put the file cursor at the end for data appending |
|
| 560 | + * |
|
| 561 | + * If $file is empty, the tar file will be created in memory |
|
| 562 | + * |
|
| 563 | + * @param string $file |
|
| 564 | + * @throws ArchiveIOException |
|
| 565 | + */ |
|
| 566 | + /* |
|
| 567 | 567 | public function openForAppend($file = '') |
| 568 | 568 | { |
| 569 | 569 | $this->file = $file; |
@@ -593,16 +593,16 @@ discard block |
||
| 593 | 593 | } |
| 594 | 594 | */ |
| 595 | 595 | |
| 596 | - /** |
|
| 597 | - * Append data to a file to the current TAR archive using an existing file in the filesystem |
|
| 598 | - * |
|
| 599 | - * @param string $file path to the original file |
|
| 600 | - * @param int $start starting reading position in file |
|
| 601 | - * @param int $end end position in reading multiple with 512 |
|
| 602 | - * @param string|FileInfo $fileinfo either the name to us in archive (string) or a FileInfo oject with all meta data, empty to take from original |
|
| 603 | - * @throws ArchiveIOException |
|
| 604 | - */ |
|
| 605 | - /* |
|
| 596 | + /** |
|
| 597 | + * Append data to a file to the current TAR archive using an existing file in the filesystem |
|
| 598 | + * |
|
| 599 | + * @param string $file path to the original file |
|
| 600 | + * @param int $start starting reading position in file |
|
| 601 | + * @param int $end end position in reading multiple with 512 |
|
| 602 | + * @param string|FileInfo $fileinfo either the name to us in archive (string) or a FileInfo oject with all meta data, empty to take from original |
|
| 603 | + * @throws ArchiveIOException |
|
| 604 | + */ |
|
| 605 | + /* |
|
| 606 | 606 | * public function appendFileData($file, $fileinfo = '', $start = 0, $limit = 0) |
| 607 | 607 | { |
| 608 | 608 | $end = $start+($limit*512); |
@@ -658,14 +658,14 @@ discard block |
||
| 658 | 658 | return $last_position; |
| 659 | 659 | }*/ |
| 660 | 660 | |
| 661 | - /** |
|
| 662 | - * Adds a file to a TAR archive by appending it's data |
|
| 663 | - * |
|
| 664 | - * @param string $archive name of the archive file |
|
| 665 | - * @param string $file name of the file to read data from |
|
| 666 | - * @param string $start start position from where to start reading data |
|
| 667 | - * @throws ArchiveIOException |
|
| 668 | - */ |
|
| 661 | + /** |
|
| 662 | + * Adds a file to a TAR archive by appending it's data |
|
| 663 | + * |
|
| 664 | + * @param string $archive name of the archive file |
|
| 665 | + * @param string $file name of the file to read data from |
|
| 666 | + * @param string $start start position from where to start reading data |
|
| 667 | + * @throws ArchiveIOException |
|
| 668 | + */ |
|
| 669 | 669 | /*public function addFileToArchive($archive, $file, $start = 0) |
| 670 | 670 | { |
| 671 | 671 | $this->openForAppend($archive); |
@@ -54,10 +54,10 @@ discard block |
||
| 54 | 54 | |
| 55 | 55 | curl_setopt($ch, CURLOPT_POST, 1); |
| 56 | 56 | curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); |
| 57 | - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); |
|
| 58 | - curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60); |
|
| 59 | - curl_setopt($ch, CURLOPT_TIMEOUT, 1200); |
|
| 60 | - curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
| 57 | + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); |
|
| 58 | + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60); |
|
| 59 | + curl_setopt($ch, CURLOPT_TIMEOUT, 1200); |
|
| 60 | + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); |
|
| 61 | 61 | |
| 62 | 62 | curl_setopt($ch, CURLOPT_POSTFIELDS, $send_array ); |
| 63 | 63 | curl_setopt($ch, CURLOPT_VERBOSE, true); |
@@ -89,9 +89,9 @@ discard block |
||
| 89 | 89 | private function curl_file_create($filename, $mimetype = '', $postname = '') { |
| 90 | 90 | if (!function_exists('curl_file_create')) { |
| 91 | 91 | |
| 92 | - return "@$filename;filename=" |
|
| 93 | - . ($postname ?: basename($filename)) |
|
| 94 | - . ($mimetype ? ";type=$mimetype" : ''); |
|
| 92 | + return "@$filename;filename=" |
|
| 93 | + . ($postname ?: basename($filename)) |
|
| 94 | + . ($mimetype ? ";type=$mimetype" : ''); |
|
| 95 | 95 | |
| 96 | 96 | }else{ |
| 97 | 97 | |
@@ -221,28 +221,28 @@ discard block |
||
| 221 | 221 | |
| 222 | 222 | // add error/update messages |
| 223 | 223 | |
| 224 | - // check if the user have submitted the settings |
|
| 225 | - // wordpress will add the "settings-updated" $_GET parameter to the url |
|
| 226 | - if (isset($_GET['settings-updated'])) { |
|
| 227 | - // add settings saved message with the class of "updated" |
|
| 228 | - add_settings_error('wporg_messages', 'wporg_message', __('Settings Saved', 'wporg'), 'updated'); |
|
| 229 | - } |
|
| 224 | + // check if the user have submitted the settings |
|
| 225 | + // wordpress will add the "settings-updated" $_GET parameter to the url |
|
| 226 | + if (isset($_GET['settings-updated'])) { |
|
| 227 | + // add settings saved message with the class of "updated" |
|
| 228 | + add_settings_error('wporg_messages', 'wporg_message', __('Settings Saved', 'wporg'), 'updated'); |
|
| 229 | + } |
|
| 230 | 230 | |
| 231 | - // show error/update messages |
|
| 232 | - settings_errors('wporg_messages'); |
|
| 233 | - ?> |
|
| 231 | + // show error/update messages |
|
| 232 | + settings_errors('wporg_messages'); |
|
| 233 | + ?> |
|
| 234 | 234 | |
| 235 | 235 | <?php |
| 236 | 236 | $xcloner_sanitization = $this->get_xcloner_container()->get_xcloner_sanitization(); |
| 237 | 237 | |
| 238 | - if( isset( $_GET[ 'tab' ] ) ) { |
|
| 239 | - $active_tab = $xcloner_sanitization->sanitize_input_as_string($_GET[ 'tab' ]); |
|
| 240 | - } // end if |
|
| 241 | - else{ |
|
| 238 | + if( isset( $_GET[ 'tab' ] ) ) { |
|
| 239 | + $active_tab = $xcloner_sanitization->sanitize_input_as_string($_GET[ 'tab' ]); |
|
| 240 | + } // end if |
|
| 241 | + else{ |
|
| 242 | 242 | $active_tab = "general_options"; |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | - ?> |
|
| 245 | + ?> |
|
| 246 | 246 | <h1><?= esc_html(get_admin_page_title()); ?></h1> |
| 247 | 247 | |
| 248 | 248 | <ul class="nav-tab-wrapper row"> |
@@ -276,9 +276,9 @@ discard block |
||
| 276 | 276 | do_settings_sections('xcloner_cleanup_settings_page'); |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | - // output save settings button |
|
| 280 | - submit_button('Save Settings'); |
|
| 281 | - ?> |
|
| 279 | + // output save settings button |
|
| 280 | + submit_button('Save Settings'); |
|
| 281 | + ?> |
|
| 282 | 282 | </form> |
| 283 | 283 | |
| 284 | 284 | </div> |
@@ -385,9 +385,9 @@ discard block |
||
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | $endpoint = sprintf( |
| 388 | - 'DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s', |
|
| 389 | - get_option("xcloner_azure_account_name"), |
|
| 390 | - get_option("xcloner_azure_api_key") |
|
| 388 | + 'DefaultEndpointsProtocol=https;AccountName=%s;AccountKey=%s', |
|
| 389 | + get_option("xcloner_azure_account_name"), |
|
| 390 | + get_option("xcloner_azure_api_key") |
|
| 391 | 391 | ); |
| 392 | 392 | |
| 393 | 393 | $blobRestProxy = ServicesBuilder::getInstance()->createBlobService($endpoint); |
@@ -431,12 +431,12 @@ discard block |
||
| 431 | 431 | |
| 432 | 432 | |
| 433 | 433 | $client = new S3Client([ |
| 434 | - 'credentials' => [ |
|
| 435 | - 'key' => get_option("xcloner_aws_key"), |
|
| 436 | - 'secret' => get_option("xcloner_aws_secret") |
|
| 437 | - ], |
|
| 438 | - 'region' => get_option("xcloner_aws_region"), |
|
| 439 | - 'version' => 'latest', |
|
| 434 | + 'credentials' => [ |
|
| 435 | + 'key' => get_option("xcloner_aws_key"), |
|
| 436 | + 'secret' => get_option("xcloner_aws_secret") |
|
| 437 | + ], |
|
| 438 | + 'region' => get_option("xcloner_aws_region"), |
|
| 439 | + 'version' => 'latest', |
|
| 440 | 440 | ]); |
| 441 | 441 | |
| 442 | 442 | $adapter = new AwsS3Adapter($client, get_option("xcloner_aws_bucket_name")); |
@@ -599,9 +599,9 @@ discard block |
||
| 599 | 599 | { |
| 600 | 600 | $query = sprintf('mimeType = \'application/vnd.google-apps.folder\' and \'%s\' in parents and name contains \'%s\'', $parent, $dir); |
| 601 | 601 | $response = $service->files->listFiles([ |
| 602 | - 'pageSize' => 1, |
|
| 603 | - 'q' => $query |
|
| 604 | - ]); |
|
| 602 | + 'pageSize' => 1, |
|
| 603 | + 'q' => $query |
|
| 604 | + ]); |
|
| 605 | 605 | |
| 606 | 606 | if(sizeof($response)) |
| 607 | 607 | { |
@@ -630,16 +630,16 @@ discard block |
||
| 630 | 630 | $this->logger->info(sprintf("Creating the FTP remote storage connection"), array("")); |
| 631 | 631 | |
| 632 | 632 | $adapter = new Adapter([ |
| 633 | - 'host' => get_option("xcloner_ftp_hostname"), |
|
| 634 | - 'username' => get_option("xcloner_ftp_username"), |
|
| 635 | - 'password' => get_option("xcloner_ftp_password"), |
|
| 636 | - |
|
| 637 | - /** optional config settings */ |
|
| 638 | - 'port' => get_option("xcloner_ftp_port", 21), |
|
| 639 | - 'root' => get_option("xcloner_ftp_path"), |
|
| 640 | - 'passive' => get_option("xcloner_ftp_transfer_mode"), |
|
| 641 | - 'ssl' => get_option("xcloner_ftp_ssl_mode"), |
|
| 642 | - 'timeout' => get_option("xcloner_ftp_timeout", 30), |
|
| 633 | + 'host' => get_option("xcloner_ftp_hostname"), |
|
| 634 | + 'username' => get_option("xcloner_ftp_username"), |
|
| 635 | + 'password' => get_option("xcloner_ftp_password"), |
|
| 636 | + |
|
| 637 | + /** optional config settings */ |
|
| 638 | + 'port' => get_option("xcloner_ftp_port", 21), |
|
| 639 | + 'root' => get_option("xcloner_ftp_path"), |
|
| 640 | + 'passive' => get_option("xcloner_ftp_transfer_mode"), |
|
| 641 | + 'ssl' => get_option("xcloner_ftp_ssl_mode"), |
|
| 642 | + 'timeout' => get_option("xcloner_ftp_timeout", 30), |
|
| 643 | 643 | ]); |
| 644 | 644 | |
| 645 | 645 | $adapter->connect(); |
@@ -656,15 +656,15 @@ discard block |
||
| 656 | 656 | $this->logger->info(sprintf("Creating the SFTP remote storage connection"), array("")); |
| 657 | 657 | |
| 658 | 658 | $adapter = new SftpAdapter([ |
| 659 | - 'host' => get_option("xcloner_sftp_hostname"), |
|
| 660 | - 'username' => get_option("xcloner_sftp_username"), |
|
| 661 | - 'password' => get_option("xcloner_sftp_password"), |
|
| 662 | - |
|
| 663 | - /** optional config settings */ |
|
| 664 | - 'port' => get_option("xcloner_sftp_port", 22), |
|
| 665 | - 'root' => get_option("xcloner_sftp_path"), |
|
| 666 | - 'privateKey' => get_option("xcloner_sftp_private_key"), |
|
| 667 | - 'timeout' => get_option("xcloner_ftp_timeout", 30), |
|
| 659 | + 'host' => get_option("xcloner_sftp_hostname"), |
|
| 660 | + 'username' => get_option("xcloner_sftp_username"), |
|
| 661 | + 'password' => get_option("xcloner_sftp_password"), |
|
| 662 | + |
|
| 663 | + /** optional config settings */ |
|
| 664 | + 'port' => get_option("xcloner_sftp_port", 22), |
|
| 665 | + 'root' => get_option("xcloner_sftp_path"), |
|
| 666 | + 'privateKey' => get_option("xcloner_sftp_private_key"), |
|
| 667 | + 'timeout' => get_option("xcloner_ftp_timeout", 30), |
|
| 668 | 668 | ]); |
| 669 | 669 | |
| 670 | 670 | $adapter->connect(); |
@@ -220,12 +220,12 @@ discard block |
||
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if( $wpdb->last_error ) { |
| 223 | - $response['error'] = 1; |
|
| 224 | - $response['error_message'] = $wpdb->last_error/*."--".$wpdb->last_query*/; |
|
| 223 | + $response['error'] = 1; |
|
| 224 | + $response['error_message'] = $wpdb->last_error/*."--".$wpdb->last_query*/; |
|
| 225 | 225 | |
| 226 | - } |
|
| 226 | + } |
|
| 227 | 227 | |
| 228 | - $scheduler->update_wp_cron_hooks(); |
|
| 228 | + $scheduler->update_wp_cron_hooks(); |
|
| 229 | 229 | $response['finished'] = 1; |
| 230 | 230 | |
| 231 | 231 | $this->send_response($response); |
@@ -916,14 +916,14 @@ discard block |
||
| 916 | 916 | $tar->close(); |
| 917 | 917 | |
| 918 | 918 | if (file_exists($tmp_file)) { |
| 919 | - header('Content-Description: File Transfer'); |
|
| 920 | - header('Content-Type: application/octet-stream'); |
|
| 921 | - header('Content-Disposition: attachment; filename="'.basename($tmp_file).'"'); |
|
| 922 | - header('Expires: 0'); |
|
| 923 | - header('Cache-Control: must-revalidate'); |
|
| 924 | - header('Pragma: public'); |
|
| 925 | - header('Content-Length: ' . filesize($tmp_file)); |
|
| 926 | - readfile($tmp_file); |
|
| 919 | + header('Content-Description: File Transfer'); |
|
| 920 | + header('Content-Type: application/octet-stream'); |
|
| 921 | + header('Content-Disposition: attachment; filename="'.basename($tmp_file).'"'); |
|
| 922 | + header('Expires: 0'); |
|
| 923 | + header('Cache-Control: must-revalidate'); |
|
| 924 | + header('Pragma: public'); |
|
| 925 | + header('Content-Length: ' . filesize($tmp_file)); |
|
| 926 | + readfile($tmp_file); |
|
| 927 | 927 | |
| 928 | 928 | } |
| 929 | 929 | |
@@ -950,24 +950,24 @@ discard block |
||
| 950 | 950 | |
| 951 | 951 | |
| 952 | 952 | header('Pragma: public'); |
| 953 | - header('Expires: 0'); |
|
| 954 | - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
|
| 955 | - header('Cache-Control: private', false); |
|
| 956 | - header('Content-Transfer-Encoding: binary'); |
|
| 957 | - header('Content-Disposition: attachment; filename="'.$metadata['path'].'";'); |
|
| 958 | - header('Content-Type: application/octet-stream'); |
|
| 959 | - header('Content-Length: ' . $metadata['size']); |
|
| 953 | + header('Expires: 0'); |
|
| 954 | + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); |
|
| 955 | + header('Cache-Control: private', false); |
|
| 956 | + header('Content-Transfer-Encoding: binary'); |
|
| 957 | + header('Content-Disposition: attachment; filename="'.$metadata['path'].'";'); |
|
| 958 | + header('Content-Type: application/octet-stream'); |
|
| 959 | + header('Content-Length: ' . $metadata['size']); |
|
| 960 | 960 | |
| 961 | - @ob_end_clean(); |
|
| 961 | + @ob_end_clean(); |
|
| 962 | 962 | |
| 963 | - $chunkSize = 1024 * 1024; |
|
| 964 | - while (!feof($read_stream)) |
|
| 965 | - { |
|
| 966 | - $buffer = fread($read_stream, $chunkSize); |
|
| 967 | - echo $buffer; |
|
| 968 | - } |
|
| 969 | - fclose($read_stream); |
|
| 970 | - exit; |
|
| 963 | + $chunkSize = 1024 * 1024; |
|
| 964 | + while (!feof($read_stream)) |
|
| 965 | + { |
|
| 966 | + $buffer = fread($read_stream, $chunkSize); |
|
| 967 | + echo $buffer; |
|
| 968 | + } |
|
| 969 | + fclose($read_stream); |
|
| 970 | + exit; |
|
| 971 | 971 | |
| 972 | 972 | } |
| 973 | 973 | |
@@ -299,12 +299,12 @@ discard block |
||
| 299 | 299 | } |
| 300 | 300 | |
| 301 | 301 | public function getMetadataFull($adapter = "storage_adapter" , $path) |
| 302 | - { |
|
| 303 | - $location = $this->$adapter->applyPathPrefix($path); |
|
| 304 | - $spl_info = new SplFileInfo($location); |
|
| 302 | + { |
|
| 303 | + $location = $this->$adapter->applyPathPrefix($path); |
|
| 304 | + $spl_info = new SplFileInfo($location); |
|
| 305 | 305 | |
| 306 | - return ($spl_info); |
|
| 307 | - } |
|
| 306 | + return ($spl_info); |
|
| 307 | + } |
|
| 308 | 308 | |
| 309 | 309 | |
| 310 | 310 | public function get_backup_archives_list($storage_selection = "") |
@@ -697,27 +697,27 @@ discard block |
||
| 697 | 697 | |
| 698 | 698 | private function array_orderby() |
| 699 | 699 | { |
| 700 | - $args = func_get_args(); |
|
| 701 | - $data = array_shift($args); |
|
| 700 | + $args = func_get_args(); |
|
| 701 | + $data = array_shift($args); |
|
| 702 | 702 | |
| 703 | - foreach ($args as $n => $field) { |
|
| 704 | - if (is_string($field)) { |
|
| 705 | - $tmp = array(); |
|
| 706 | - foreach ($data as $key => $row) |
|
| 707 | - { |
|
| 703 | + foreach ($args as $n => $field) { |
|
| 704 | + if (is_string($field)) { |
|
| 705 | + $tmp = array(); |
|
| 706 | + foreach ($data as $key => $row) |
|
| 707 | + { |
|
| 708 | 708 | if(is_array($row)) |
| 709 | 709 | $tmp[$key] = $row[$field]; |
| 710 | 710 | else |
| 711 | 711 | $tmp[$key] = $row->$field; |
| 712 | 712 | } |
| 713 | - $args[$n] = $tmp; |
|
| 714 | - } |
|
| 715 | - } |
|
| 716 | - $args[] = &$data; |
|
| 713 | + $args[$n] = $tmp; |
|
| 714 | + } |
|
| 715 | + } |
|
| 716 | + $args[] = &$data; |
|
| 717 | 717 | |
| 718 | - call_user_func_array('array_multisort', $args); |
|
| 718 | + call_user_func_array('array_multisort', $args); |
|
| 719 | 719 | |
| 720 | - return array_pop($args); |
|
| 720 | + return array_pop($args); |
|
| 721 | 721 | } |
| 722 | 722 | |
| 723 | 723 | private function check_file_diff_time($file) |
@@ -158,15 +158,15 @@ discard block |
||
| 158 | 158 | } |
| 159 | 159 | |
| 160 | 160 | private function friendly_error_type($type) { |
| 161 | - static $levels=null; |
|
| 162 | - if ($levels===null) { |
|
| 163 | - $levels=[]; |
|
| 164 | - foreach (get_defined_constants() as $key=>$value) { |
|
| 165 | - if (strpos($key,'E_')!==0) {continue;} |
|
| 161 | + static $levels=null; |
|
| 162 | + if ($levels===null) { |
|
| 163 | + $levels=[]; |
|
| 164 | + foreach (get_defined_constants() as $key=>$value) { |
|
| 165 | + if (strpos($key,'E_')!==0) {continue;} |
|
| 166 | 166 | $levels[$value]= $key; //substr($key,2); |
| 167 | - } |
|
| 168 | - } |
|
| 169 | - return (isset($levels[$type]) ? $levels[$type] : "Error #{$type}"); |
|
| 167 | + } |
|
| 168 | + } |
|
| 169 | + return (isset($levels[$type]) ? $levels[$type] : "Error #{$type}"); |
|
| 170 | 170 | } |
| 171 | 171 | |
| 172 | 172 | public function get_logger_filename() |
@@ -887,19 +887,19 @@ discard block |
||
| 887 | 887 | } |
| 888 | 888 | |
| 889 | 889 | private function return_bytes($val) { |
| 890 | - $val = trim($val); |
|
| 891 | - $last = strtolower($val[strlen($val)-1]); |
|
| 892 | - switch($last) { |
|
| 893 | - // The 'G' modifier is available since PHP 5.1.0 |
|
| 894 | - case 'g': |
|
| 895 | - $val *= 1024; |
|
| 896 | - case 'm': |
|
| 897 | - $val *= 1024; |
|
| 898 | - case 'k': |
|
| 899 | - $val *= 1024; |
|
| 900 | - } |
|
| 890 | + $val = trim($val); |
|
| 891 | + $last = strtolower($val[strlen($val)-1]); |
|
| 892 | + switch($last) { |
|
| 893 | + // The 'G' modifier is available since PHP 5.1.0 |
|
| 894 | + case 'g': |
|
| 895 | + $val *= 1024; |
|
| 896 | + case 'm': |
|
| 897 | + $val *= 1024; |
|
| 898 | + case 'k': |
|
| 899 | + $val *= 1024; |
|
| 900 | + } |
|
| 901 | 901 | |
| 902 | - return $val; |
|
| 902 | + return $val; |
|
| 903 | 903 | } |
| 904 | 904 | |
| 905 | 905 | public function is_multipart($backup_name) |
@@ -947,7 +947,7 @@ discard block |
||
| 947 | 947 | { |
| 948 | 948 | $direction = strtolower($direction); |
| 949 | 949 | |
| 950 | - usort($array, create_function('$a, $b', ' |
|
| 950 | + usort($array, create_function('$a, $b', ' |
|
| 951 | 951 | $a = $a["' . $field . '"]; |
| 952 | 952 | $b = $b["' . $field . '"]; |
| 953 | 953 | |
@@ -959,7 +959,7 @@ discard block |
||
| 959 | 959 | return ($a ' . ($direction == 'desc' ? '>' : '<') .' $b) ? -1 : 1; |
| 960 | 960 | ')); |
| 961 | 961 | |
| 962 | - return true; |
|
| 962 | + return true; |
|
| 963 | 963 | } |
| 964 | 964 | |
| 965 | 965 | public static function send_response($status = 200, $response) |
@@ -999,10 +999,10 @@ discard block |
||
| 999 | 999 | $m[3] = ""; |
| 1000 | 1000 | |
| 1001 | 1001 | $data = 's:'.strlen(($m[3])).':\"'.($m[3]).'\";'; |
| 1002 | - //return $this->unescape_quotes($data); |
|
| 1002 | + //return $this->unescape_quotes($data); |
|
| 1003 | 1003 | |
| 1004 | - return $data; |
|
| 1005 | - }, $query); |
|
| 1004 | + return $data; |
|
| 1005 | + }, $query); |
|
| 1006 | 1006 | } |
| 1007 | 1007 | |
| 1008 | 1008 | private function unescape_quotes($value) { |
@@ -1019,14 +1019,14 @@ discard block |
||
| 1019 | 1019 | private function has_serialized($s) |
| 1020 | 1020 | { |
| 1021 | 1021 | if( |
| 1022 | - stristr($s, '{' ) != false && |
|
| 1023 | - stristr($s, '}' ) != false && |
|
| 1024 | - stristr($s, ';' ) != false && |
|
| 1025 | - stristr($s, ':' ) != false |
|
| 1026 | - ){ |
|
| 1027 | - return true; |
|
| 1022 | + stristr($s, '{' ) != false && |
|
| 1023 | + stristr($s, '}' ) != false && |
|
| 1024 | + stristr($s, ';' ) != false && |
|
| 1025 | + stristr($s, ':' ) != false |
|
| 1026 | + ){ |
|
| 1027 | + return true; |
|
| 1028 | 1028 | }else{ |
| 1029 | - return false; |
|
| 1029 | + return false; |
|
| 1030 | 1030 | } |
| 1031 | 1031 | |
| 1032 | 1032 | } |