GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Branch dev (79c8c7)
by Liuta
02:51
created
includes/class-xcloner-api.php 1 patch
Spacing   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
 		$this->xcloner_remote_storage   = $xcloner_container->get_xcloner_remote_storage();
91 91
 
92 92
 		if (isset($_POST['API_ID'])) {
93
-			$this->logger->info("Processing ajax request ID " . substr($this->xcloner_sanitization->sanitize_input_as_string($_POST['API_ID']),
93
+			$this->logger->info("Processing ajax request ID ".substr($this->xcloner_sanitization->sanitize_input_as_string($_POST['API_ID']),
94 94
 					0, 15));
95 95
 		}
96 96
 
@@ -131,13 +131,13 @@  discard block
 block discarded – undo
131 131
 
132 132
 
133 133
 		$data['recordsPerSession'] = $this->xcloner_settings->get_xcloner_option('xcloner_database_records_per_request');
134
-		$data['TEMP_DBPROCESS_FILE'] = $this->xcloner_settings->get_xcloner_tmp_path() . DS . ".database";
135
-		$data['TEMP_DUMP_FILE'] = $this->xcloner_settings->get_xcloner_tmp_path() . DS . "database-sql.sql";
134
+		$data['TEMP_DBPROCESS_FILE'] = $this->xcloner_settings->get_xcloner_tmp_path().DS.".database";
135
+		$data['TEMP_DUMP_FILE'] = $this->xcloner_settings->get_xcloner_tmp_path().DS."database-sql.sql";
136 136
 
137 137
 		try {
138 138
 			$this->xcloner_database->init($data);
139 139
 
140
-		} catch (Exception $e) {
140
+		}catch (Exception $e) {
141 141
 
142 142
 			$this->send_response($e->getMessage());
143 143
 			$this->logger->error($e->getMessage());
@@ -223,8 +223,8 @@  discard block
 block discarded – undo
223 223
 		} else {
224 224
 
225 225
 			$schedule['status'] = 1;
226
-			$schedule['start_at'] = strtotime($this->form_params['backup_params']['schedule_start_date'] .
227
-				" " . $this->form_params['backup_params']['schedule_start_time']);
226
+			$schedule['start_at'] = strtotime($this->form_params['backup_params']['schedule_start_date'].
227
+				" ".$this->form_params['backup_params']['schedule_start_time']);
228 228
 
229 229
 			if ($schedule['start_at'] <= time()) {
230 230
 				$schedule['start_at'] = "";
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 
250 250
 		if (!isset($_POST['id'])) {
251 251
 			$wpdb->insert(
252
-				$wpdb->prefix . 'xcloner_scheduler',
252
+				$wpdb->prefix.'xcloner_scheduler',
253 253
 				$schedule,
254 254
 				array(
255 255
 					'%s',
@@ -258,7 +258,7 @@  discard block
 block discarded – undo
258 258
 			);
259 259
 		} else {
260 260
 			$wpdb->update(
261
-				$wpdb->prefix . 'xcloner_scheduler',
261
+				$wpdb->prefix.'xcloner_scheduler',
262 262
 				$schedule,
263 263
 				array('id' => $_POST['id']),
264 264
 				array(
@@ -312,7 +312,7 @@  discard block
 block discarded – undo
312 312
 		try {
313 313
 			$return = $this->archive_system->start_incremental_backup($this->form_params['backup_params'],
314 314
 				$this->form_params['extra'], $init);
315
-		} catch (Exception $e) {
315
+		}catch (Exception $e) {
316 316
 			$return = array();
317 317
 			$return['error'] = true;
318 318
 			$return['status'] = 500;
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 					$additional['lines_total'] = $return['extra']['lines_total'];
340 340
 					$this->archive_system->send_notification($to, $from, $subject, $return['extra']['backup_parent'],
341 341
 						$this->form_params, "", $additional);
342
-				} catch (Exception $e) {
342
+				}catch (Exception $e) {
343 343
 					$this->logger->error($e->getMessage());
344 344
 				}
345 345
 			}
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
 		if (isset($params->backup_params)) {
438 438
 			foreach ($params->backup_params as $param) {
439 439
 				$this->form_params['backup_params'][$param->name] = $this->xcloner_sanitization->sanitize_input_as_string($param->value);
440
-				$this->logger->debug("Adding form parameter " . $param->name . "." . $param->value . "\n", array(
440
+				$this->logger->debug("Adding form parameter ".$param->name.".".$param->value."\n", array(
441 441
 					'POST',
442 442
 					'fields filter'
443 443
 				));
@@ -449,7 +449,7 @@  discard block
 block discarded – undo
449 449
 		if (isset($params->table_params)) {
450 450
 			foreach ($params->table_params as $param) {
451 451
 				$this->form_params['database'][$param->parent][] = $this->xcloner_sanitization->sanitize_input_as_raw($param->id);
452
-				$this->logger->debug("Adding database filter " . $param->parent . "." . $param->id . "\n", array(
452
+				$this->logger->debug("Adding database filter ".$param->parent.".".$param->id."\n", array(
453 453
 					'POST',
454 454
 					'database filter'
455 455
 				));
@@ -468,7 +468,7 @@  discard block
 block discarded – undo
468 468
 				if (!in_array($param->parent, $this->form_params['excluded_files'])) {
469 469
 					//$this->form_params['excluded_files'][] = $this->xcloner_sanitization->sanitize_input_as_relative_path($param->id);
470 470
 					$unique_exclude_files[] = $param->id;
471
-					$this->logger->debug("Adding file filter " . $param->id . "\n", array(
471
+					$this->logger->debug("Adding file filter ".$param->id."\n", array(
472 472
 						'POST',
473 473
 						'exclude files filter'
474 474
 					));
@@ -516,13 +516,13 @@  discard block
 block discarded – undo
516 516
 				'text' => $this->xcloner_settings->get_xcloner_start_path(),
517 517
 				//'children' => true,
518 518
 				'state' => array('selected' => false, 'opened' => true),
519
-				'icon' => plugin_dir_url(dirname(__FILE__)) . "/admin/assets/file-icon-root.png"
519
+				'icon' => plugin_dir_url(dirname(__FILE__))."/admin/assets/file-icon-root.png"
520 520
 			);
521 521
 		}
522 522
 
523 523
 		try {
524 524
 			$files = $this->xcloner_file_system->list_directory($folder);
525
-		} catch (Exception $e) {
525
+		}catch (Exception $e) {
526 526
 
527 527
 			print $e->getMessage();
528 528
 			$this->logger->error($e->getMessage());
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
 			if ($file['type'] == "dir") {
544 544
 				$children = true;
545 545
 			} else {
546
-				$text .= " (" . $this->xcloner_requirements->file_format_size($file['size']) . ")";
546
+				$text .= " (".$this->xcloner_requirements->file_format_size($file['size']).")";
547 547
 			}
548 548
 
549 549
 			if ($this->xcloner_file_system->is_excluded($file)) {
@@ -559,8 +559,8 @@  discard block
 block discarded – undo
559 559
 				//'title' => "test",
560 560
 				'children' => $children,
561 561
 				'state' => array('selected' => $selected, 'opened' => false, "checkbox_disabled" => $selected),
562
-				'icon' => plugin_dir_url(dirname(__FILE__)) . "/admin/assets/file-icon-" . strtolower(substr($file['type'],
563
-						0, 1)) . ".png"
562
+				'icon' => plugin_dir_url(dirname(__FILE__))."/admin/assets/file-icon-".strtolower(substr($file['type'],
563
+						0, 1)).".png"
564 564
 			);
565 565
 		}
566 566
 
@@ -586,7 +586,7 @@  discard block
 block discarded – undo
586 586
 		if ($database == "#") {
587 587
 			try {
588 588
 				$return = $this->xcloner_database->get_all_databases();
589
-			} catch (Exception $e) {
589
+			}catch (Exception $e) {
590 590
 				$this->logger->error($e->getMessage());
591 591
 			}
592 592
 
@@ -607,10 +607,10 @@  discard block
 block discarded – undo
607 607
 				$data[] = array(
608 608
 					'id' => $database['name'],
609 609
 					'parent' => '#',
610
-					'text' => $database['name'] . " (" . (int)$database['num_tables'] . ")",
610
+					'text' => $database['name']." (".(int)$database['num_tables'].")",
611 611
 					'children' => true,
612 612
 					'state' => $state,
613
-					'icon' => plugin_dir_url(dirname(__FILE__)) . "/admin/assets/database-icon.png"
613
+					'icon' => plugin_dir_url(dirname(__FILE__))."/admin/assets/database-icon.png"
614 614
 				);
615 615
 			}
616 616
 
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
 
619 619
 			try {
620 620
 				$return = $this->xcloner_database->list_tables($database, "", 1);
621
-			} catch (Exception $e) {
621
+			}catch (Exception $e) {
622 622
 				$this->logger->error($e->getMessage());
623 623
 			}
624 624
 
@@ -635,12 +635,12 @@  discard block
 block discarded – undo
635 635
 				}
636 636
 
637 637
 				$data[] = array(
638
-					'id' => $database . "." . $table['name'],
638
+					'id' => $database.".".$table['name'],
639 639
 					'parent' => $database,
640
-					'text' => $table['name'] . " (" . (int)$table['records'] . ")",
640
+					'text' => $table['name']." (".(int)$table['records'].")",
641 641
 					'children' => false,
642 642
 					'state' => $state,
643
-					'icon' => plugin_dir_url(dirname(__FILE__)) . "/admin/assets/table-icon.png"
643
+					'icon' => plugin_dir_url(dirname(__FILE__))."/admin/assets/table-icon.png"
644 644
 				);
645 645
 			}
646 646
 		}
@@ -686,17 +686,17 @@  discard block
 block discarded – undo
686 686
 		$return['data'] = array();
687 687
 
688 688
 		foreach ($data as $res) {
689
-			$action = "<a href=\"#" . $res->id . "\" class=\"edit\" title='Edit'> <i class=\"material-icons \">edit</i></a>
690
-					<a href=\"#" . $res->id . "\" class=\"delete\" title='Delete'><i class=\"material-icons  \">delete</i></a>";
689
+			$action = "<a href=\"#".$res->id."\" class=\"edit\" title='Edit'> <i class=\"material-icons \">edit</i></a>
690
+					<a href=\"#" . $res->id."\" class=\"delete\" title='Delete'><i class=\"material-icons  \">delete</i></a>";
691 691
 			if ($res->status) {
692 692
 				$status = '<i class="material-icons active status">timer</i>';
693 693
 			} else {
694 694
 				$status = '<i class="material-icons status inactive">timer_off</i>';
695 695
 			}
696 696
 
697
-			$next_run_time = wp_next_scheduled('xcloner_scheduler_' . $res->id, array($res->id));
697
+			$next_run_time = wp_next_scheduled('xcloner_scheduler_'.$res->id, array($res->id));
698 698
 
699
-			$next_run = date(get_option('date_format') . " " . get_option('time_format'), $next_run_time);
699
+			$next_run = date(get_option('date_format')." ".get_option('time_format'), $next_run_time);
700 700
 
701 701
 			$remote_storage = $res->remote_storage;
702 702
 
@@ -705,16 +705,16 @@  discard block
 block discarded – undo
705 705
 			}
706 706
 
707 707
 			if (trim($next_run)) {
708
-				$date_text = date(get_option('date_format') . " " . get_option('time_format'),
708
+				$date_text = date(get_option('date_format')." ".get_option('time_format'),
709 709
 					$next_run_time + (get_option('gmt_offset') * HOUR_IN_SECONDS));
710 710
 
711 711
 				if ($next_run_time >= time()) {
712
-					$next_run = "in " . human_time_diff($next_run_time, time());
712
+					$next_run = "in ".human_time_diff($next_run_time, time());
713 713
 				} else {
714 714
 					$next_run = __("executed", 'xcloner-backup-and-restore');
715 715
 				}
716 716
 
717
-				$next_run = "<a href='#' title='" . $date_text . "'>" . $next_run . "</a>";
717
+				$next_run = "<a href='#' title='".$date_text."'>".$next_run."</a>";
718 718
 				//$next_run .=" ($date_text)";
719 719
 			}
720 720
 
@@ -726,11 +726,11 @@  discard block
 block discarded – undo
726 726
 				if ($this->xcloner_file_system->get_storage_filesystem()->has($res->last_backup)) {
727 727
 					$metadata = $this->xcloner_file_system->get_storage_filesystem()->getMetadata($res->last_backup);
728 728
 					$backup_size = size_format($this->xcloner_file_system->get_backup_size($res->last_backup));
729
-					$backup_time = date(get_option('date_format') . " " . get_option('time_format'),
729
+					$backup_time = date(get_option('date_format')." ".get_option('time_format'),
730 730
 						$metadata['timestamp'] + (get_option('gmt_offset') * HOUR_IN_SECONDS));
731 731
 				}
732 732
 
733
-				$backup_text = "<span title='" . $backup_time . "' class='shorten_string'>" . $res->last_backup . " (" . $backup_size . ")</span>";
733
+				$backup_text = "<span title='".$backup_time."' class='shorten_string'>".$res->last_backup." (".$backup_size.")</span>";
734 734
 			}
735 735
 
736 736
 			$schedules = wp_get_schedules();
@@ -742,7 +742,7 @@  discard block
 block discarded – undo
742 742
 			$return['data'][] = array(
743 743
 				$res->id,
744 744
 				$res->name,
745
-				$res->recurrence,/*$res->start_at,*/
745
+				$res->recurrence, /*$res->start_at,*/
746 746
 				$next_run,
747 747
 				$remote_storage,
748 748
 				$backup_text,
@@ -808,25 +808,25 @@  discard block
 block discarded – undo
808 808
 			$this->process_params($params);
809 809
 			$source_backup_file = $this->xcloner_sanitization->sanitize_input_as_string($this->form_params['extra']['backup_parent']);
810 810
 
811
-			if(isset($this->form_params['extra']['start'])) {
811
+			if (isset($this->form_params['extra']['start'])) {
812 812
 				$start = $this->xcloner_sanitization->sanitize_input_as_int($this->form_params['extra']['start']);
813
-			}else{
813
+			} else {
814 814
 				$start = 0;
815 815
 			}
816 816
 
817
-			if(isset($this->form_params['extra']['iv'])) {
817
+			if (isset($this->form_params['extra']['iv'])) {
818 818
 				$iv = $this->xcloner_sanitization->sanitize_input_as_raw($this->form_params['extra']['iv']);
819
-			}else{
819
+			} else {
820 820
 				$iv = "";
821 821
 			}
822 822
 
823
-			if(isset($this->form_params['extra']['part'])) {
823
+			if (isset($this->form_params['extra']['part'])) {
824 824
 				$return['part'] = (int)$this->xcloner_sanitization->sanitize_input_as_int($this->form_params['extra']['part']);
825
-			}else{
825
+			} else {
826 826
 				$return['part'] = 0;
827 827
 			}
828 828
 
829
-		}else{
829
+		} else {
830 830
 			$source_backup_file = $this->xcloner_sanitization->sanitize_input_as_string($_POST['file']);
831 831
 			$start = $this->xcloner_sanitization->sanitize_input_as_int($_POST['start']);
832 832
 			$iv = $this->xcloner_sanitization->sanitize_input_as_raw($_POST['iv']);
@@ -841,14 +841,14 @@  discard block
 block discarded – undo
841 841
 		}
842 842
 
843 843
 		$return['processing_file'] = $backup_file;
844
-		$return['total_size'] = filesize($this->xcloner_settings->get_xcloner_store_path() . DS . $backup_file);
844
+		$return['total_size'] = filesize($this->xcloner_settings->get_xcloner_store_path().DS.$backup_file);
845 845
 
846 846
 		try {
847 847
 			$this->logger->info(json_encode($_POST));
848 848
 			$this->logger->info($iv);
849 849
 			$return = array_merge($return,
850 850
 				$this->xcloner_encryption->encrypt_file($backup_file, "", "", $start, base64_decode($iv)));
851
-		}catch(\Exception $e){
851
+		}catch (\Exception $e) {
852 852
 			$return['error'] = true;
853 853
 			$return['message'] = $e->getMessage();
854 854
 			$return['error_message'] = $e->getMessage();
@@ -856,7 +856,7 @@  discard block
 block discarded – undo
856 856
 
857 857
 		//echo strlen($return['iv']);exit;
858 858
 
859
-		if($return['finished']) {
859
+		if ($return['finished']) {
860 860
 			if ($this->xcloner_file_system->is_multipart($source_backup_file)) {
861 861
 				$return['start'] = 0;
862 862
 
@@ -870,7 +870,7 @@  discard block
 block discarded – undo
870 870
 		}
871 871
 
872 872
 		if (isset($_POST['data'])) {
873
-			$return['extra'] = array_merge($this->form_params['extra'],  $return);
873
+			$return['extra'] = array_merge($this->form_params['extra'], $return);
874 874
 		}
875 875
 
876 876
 		$this->send_response($return, 0);
@@ -889,7 +889,7 @@  discard block
 block discarded – undo
889 889
 		$source_backup_file = $this->xcloner_sanitization->sanitize_input_as_string($_POST['file']);
890 890
 		$start = $this->xcloner_sanitization->sanitize_input_as_int($_POST['start']);
891 891
 		$iv = $this->xcloner_sanitization->sanitize_input_as_raw($_POST['iv']);
892
-		$decryption_key = $this->xcloner_sanitization->sanitize_input_as_raw($_POST['decryption_key']);;
892
+		$decryption_key = $this->xcloner_sanitization->sanitize_input_as_raw($_POST['decryption_key']); ;
893 893
 		$return['part'] = $this->xcloner_sanitization->sanitize_input_as_int($_POST['part']);
894 894
 
895 895
 		$backup_file = $source_backup_file;
@@ -900,17 +900,17 @@  discard block
 block discarded – undo
900 900
 		}
901 901
 
902 902
 		$return['processing_file'] = $backup_file;
903
-		$return['total_size'] = filesize($this->xcloner_settings->get_xcloner_store_path() . DS . $backup_file);
903
+		$return['total_size'] = filesize($this->xcloner_settings->get_xcloner_store_path().DS.$backup_file);
904 904
 
905 905
 		try {
906 906
 			$return = array_merge($return,
907 907
 				$this->xcloner_encryption->decrypt_file($backup_file, "", $decryption_key, $start, base64_decode($iv)));
908
-		}catch(\Exception $e){
908
+		}catch (\Exception $e) {
909 909
 			$return['error'] = true;
910 910
 			$return['message'] = $e->getMessage();
911 911
 		}
912 912
 
913
-		if($return['finished']) {
913
+		if ($return['finished']) {
914 914
 			if ($this->xcloner_file_system->is_multipart($source_backup_file)) {
915 915
 				$return['start'] = 0;
916 916
 
@@ -944,7 +944,7 @@  discard block
 block discarded – undo
944 944
 		foreach ($backup_list as $file_info):?>
945 945
             <?php
946 946
 			if ($storage_selection == "gdrive") {
947
-				$file_info['path'] = $file_info['filename'] . "." . $file_info['extension'];
947
+				$file_info['path'] = $file_info['filename'].".".$file_info['extension'];
948 948
 			}
949 949
 			$file_exists_on_local_storage = true;
950 950
 
@@ -1065,10 +1065,10 @@  discard block
 block discarded – undo
1065 1065
                             <?php endif ?>
1066 1066
                             <?php
1067 1067
 							$basename = $file_info['basename'];
1068
-							if(isset($file_info['childs']) and sizeof($file_info['childs']))
1068
+							if (isset($file_info['childs']) and sizeof($file_info['childs']))
1069 1069
 								$basename = $file_info['childs'][0][0];
1070 1070
 							?>
1071
-                            <?php if($this->xcloner_encryption->is_encrypted_file($basename)) :?>
1071
+                            <?php if ($this->xcloner_encryption->is_encrypted_file($basename)) :?>
1072 1072
                                 <a href="#<?php echo $file_info['basename'] ?>" class="backup-decryption"
1073 1073
                                    title="<?php echo __('Backup Decryption', 'xcloner-backup-and-restore') ?>">
1074 1074
                                     <i class="material-icons">enhanced_encryption</i>
@@ -1126,7 +1126,7 @@  discard block
 block discarded – undo
1126 1126
 			$backup_file = $backup_parts[$return['part']];
1127 1127
 		}
1128 1128
 
1129
-		if($this->xcloner_encryption->is_encrypted_file($backup_file)) {
1129
+		if ($this->xcloner_encryption->is_encrypted_file($backup_file)) {
1130 1130
 			$return['error'] = true;
1131 1131
 			$return['message'] = __("Backup archive is encrypted, please decrypt it first before you can list it's content.", "xcloner-backup-and-restore");
1132 1132
 			$this->send_response($return, 0);
@@ -1134,10 +1134,10 @@  discard block
 block discarded – undo
1134 1134
 
1135 1135
 		try {
1136 1136
 			$tar = new Tar();
1137
-			$tar->open($this->xcloner_settings->get_xcloner_store_path() . DS . $backup_file, $start);
1137
+			$tar->open($this->xcloner_settings->get_xcloner_store_path().DS.$backup_file, $start);
1138 1138
 
1139 1139
 			$data = $tar->contents(get_option('xcloner_files_to_process_per_request'));
1140
-		} catch (Exception $e) {
1140
+		}catch (Exception $e) {
1141 1141
 			$return['error'] = true;
1142 1142
 			$return['message'] = $e->getMessage();
1143 1143
 			$this->send_response($return, 0);
@@ -1145,14 +1145,14 @@  discard block
 block discarded – undo
1145 1145
 
1146 1146
 		$return['files'] = array();
1147 1147
 		$return['finished'] = 1;
1148
-		$return['total_size'] = filesize($this->xcloner_settings->get_xcloner_store_path() . DS . $backup_file);
1148
+		$return['total_size'] = filesize($this->xcloner_settings->get_xcloner_store_path().DS.$backup_file);
1149 1149
 		$i = 0;
1150 1150
 
1151 1151
 		if (isset($data['extracted_files']) and is_array($data['extracted_files'])) {
1152 1152
 			foreach ($data['extracted_files'] as $file) {
1153 1153
 				$return['files'][$i]['path'] = $file->getPath();
1154 1154
 				$return['files'][$i]['size'] = $file->getSize();
1155
-				$return['files'][$i]['mtime'] = date(get_option('date_format') . " " . get_option('time_format'),
1155
+				$return['files'][$i]['mtime'] = date(get_option('date_format')." ".get_option('time_format'),
1156 1156
 					$file->getMtime());
1157 1157
 
1158 1158
 				$i++;
@@ -1200,7 +1200,7 @@  discard block
 block discarded – undo
1200 1200
 					"copy_backup_remote_to_local"
1201 1201
 				), array($backup_file, $storage_type));
1202 1202
 			}
1203
-		} catch (Exception $e) {
1203
+		}catch (Exception $e) {
1204 1204
 
1205 1205
 			$return['error'] = 1;
1206 1206
 			$return['message'] = $e->getMessage();
@@ -1239,7 +1239,7 @@  discard block
 block discarded – undo
1239 1239
 					"upload_backup_to_storage"
1240 1240
 				), array($backup_file, $storage_type));
1241 1241
 			}
1242
-		} catch (Exception $e) {
1242
+		}catch (Exception $e) {
1243 1243
 
1244 1244
 			$return['error'] = 1;
1245 1245
 			$return['message'] = $e->getMessage();
@@ -1301,21 +1301,21 @@  discard block
 block discarded – undo
1301 1301
         $phar2->setStub($phar2->createDefaultStub('vendor/autoload.php', 'vendor/autoload.php'));
1302 1302
          * */
1303 1303
 
1304
-		$tmp_file = $this->xcloner_settings->get_xcloner_tmp_path() . DS . "xcloner-restore.tgz";
1304
+		$tmp_file = $this->xcloner_settings->get_xcloner_tmp_path().DS."xcloner-restore.tgz";
1305 1305
 
1306 1306
 		$tar = new Tar();
1307 1307
 		$tar->create($tmp_file);
1308 1308
 
1309
-		$tar->addFile(dirname(__DIR__) . "/restore/vendor.build.txt", "vendor.phar");
1309
+		$tar->addFile(dirname(__DIR__)."/restore/vendor.build.txt", "vendor.phar");
1310 1310
 		//$tar->addFile(dirname(__DIR__)."/restore/vendor.tgz", "vendor.tgz");
1311 1311
 
1312 1312
 		$files = $xcloner_plugin_filesystem->listContents("vendor/", true);
1313 1313
 		foreach ($files as $file) {
1314
-			$tar->addFile(dirname(__DIR__) . DS . $file['path'], $file['path']);
1314
+			$tar->addFile(dirname(__DIR__).DS.$file['path'], $file['path']);
1315 1315
 		}
1316 1316
 
1317
-		$content = file_get_contents(dirname(__DIR__) . "/restore/xcloner_restore.php");
1318
-		$content = str_replace("define('AUTH_KEY', '');", "define('AUTH_KEY', '" . md5(AUTH_KEY) . "');", $content);
1317
+		$content = file_get_contents(dirname(__DIR__)."/restore/xcloner_restore.php");
1318
+		$content = str_replace("define('AUTH_KEY', '');", "define('AUTH_KEY', '".md5(AUTH_KEY)."');", $content);
1319 1319
 
1320 1320
 		$tar->addData("xcloner_restore.php", $content);
1321 1321
 
@@ -1324,18 +1324,18 @@  discard block
 block discarded – undo
1324 1324
 		if (file_exists($tmp_file)) {
1325 1325
 			header('Content-Description: File Transfer');
1326 1326
 			header('Content-Type: application/octet-stream');
1327
-			header('Content-Disposition: attachment; filename="' . basename($tmp_file) . '"');
1327
+			header('Content-Disposition: attachment; filename="'.basename($tmp_file).'"');
1328 1328
 			header('Expires: 0');
1329 1329
 			header('Cache-Control: must-revalidate');
1330 1330
 			header('Pragma: public');
1331
-			header('Content-Length: ' . filesize($tmp_file));
1331
+			header('Content-Length: '.filesize($tmp_file));
1332 1332
 			readfile($tmp_file);
1333 1333
 
1334 1334
 		}
1335 1335
 
1336 1336
 		try {
1337 1337
             unlink($tmp_file);
1338
-        }catch(Exception $e) {
1338
+        }catch (Exception $e) {
1339 1339
 		    //We are not interested in the error here
1340 1340
         }
1341 1341
 
@@ -1365,9 +1365,9 @@  discard block
 block discarded – undo
1365 1365
 		header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
1366 1366
 		header('Cache-Control: private', false);
1367 1367
 		header('Content-Transfer-Encoding: binary');
1368
-		header('Content-Disposition: attachment; filename="' . $metadata['path'] . '";');
1368
+		header('Content-Disposition: attachment; filename="'.$metadata['path'].'";');
1369 1369
 		header('Content-Type: application/octet-stream');
1370
-		header('Content-Length: ' . $metadata['size']);
1370
+		header('Content-Length: '.$metadata['size']);
1371 1371
 
1372 1372
 		ob_end_clean();
1373 1373
 
@@ -1430,12 +1430,12 @@  discard block
 block discarded – undo
1430 1430
 			$xcloner_file_transfer->set_target($target_url);
1431 1431
 			$return['start'] = $xcloner_file_transfer->transfer_file($file, $start, $hash);
1432 1432
 
1433
-		} catch (Exception $e) {
1433
+		}catch (Exception $e) {
1434 1434
 
1435 1435
 			$return = array();
1436 1436
 			$return['error'] = true;
1437 1437
 			$return['status'] = 500;
1438
-			$return['message'] = "CURL communication error with the restore host. " . $e->getMessage();
1438
+			$return['message'] = "CURL communication error with the restore host. ".$e->getMessage();
1439 1439
 			$this->send_response($return, 0);
1440 1440
 
1441 1441
 		}
@@ -1459,7 +1459,7 @@  discard block
 block discarded – undo
1459 1459
 		$this->check_access();
1460 1460
 
1461 1461
 		define("XCLONER_PLUGIN_ACCESS", 1);
1462
-		include_once(dirname(__DIR__) . DS . "restore" . DS . "xcloner_restore.php");
1462
+		include_once(dirname(__DIR__).DS."restore".DS."xcloner_restore.php");
1463 1463
 
1464 1464
 		return;
1465 1465
 	}
Please login to merge, or discard this patch.