@@ -137,7 +137,7 @@ discard block |
||
| 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()); |
@@ -312,7 +312,7 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -522,7 +522,7 @@ discard block |
||
| 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()); |
@@ -586,7 +586,7 @@ discard block |
||
| 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 | |
@@ -618,7 +618,7 @@ discard block |
||
| 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 | |
@@ -848,7 +848,7 @@ discard block |
||
| 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(); |
@@ -905,7 +905,7 @@ discard block |
||
| 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 | } |
@@ -1009,7 +1009,8 @@ discard block |
||
| 1009 | 1009 | title="<?php echo __('Backup Decryption', 'xcloner-backup-and-restore') ?>"> |
| 1010 | 1010 | <i class="material-icons">enhanced_encryption</i> |
| 1011 | 1011 | </a> |
| 1012 | - <?php else: ?> |
|
| 1012 | + <?php else { |
|
| 1013 | + : ?> |
|
| 1013 | 1014 | <a href="#<?php echo $child[0] ?>" class="list-backup-content" |
| 1014 | 1015 | title="<?php echo __('List Backup Content', |
| 1015 | 1016 | 'xcloner-backup-and-restore') ?>"><i |
@@ -1028,7 +1029,9 @@ discard block |
||
| 1028 | 1029 | class="material-icons">file_upload</i></a> |
| 1029 | 1030 | <?php endif ?> |
| 1030 | 1031 | </li> |
| 1031 | - <?php endforeach; ?> |
|
| 1032 | + <?php endforeach; |
|
| 1033 | +} |
|
| 1034 | +?> |
|
| 1032 | 1035 | </ul> |
| 1033 | 1036 | <?php endif; ?> |
| 1034 | 1037 | <?php |
@@ -1036,11 +1039,12 @@ discard block |
||
| 1036 | 1039 | ob_end_clean(); |
| 1037 | 1040 | ?> |
| 1038 | 1041 | <?php ob_start(); ?> |
| 1039 | - <?php if (isset($file_info['timestamp'])) |
|
| 1042 | + <?php if (isset($file_info['timestamp'])) { |
|
| 1040 | 1043 | echo date("Y-m-d H:i", $file_info['timestamp']) |
| 1041 | 1044 | ?> |
| 1042 | 1045 | <?php |
| 1043 | 1046 | $return['data'][$i][] = ob_get_contents(); |
| 1047 | +} |
|
| 1044 | 1048 | ob_end_clean(); |
| 1045 | 1049 | ?> |
| 1046 | 1050 | |
@@ -1065,15 +1069,17 @@ discard block |
||
| 1065 | 1069 | <?php endif ?> |
| 1066 | 1070 | <?php |
| 1067 | 1071 | $basename = $file_info['basename']; |
| 1068 | - if (isset($file_info['childs']) and sizeof($file_info['childs'])) |
|
| 1069 | - $basename = $file_info['childs'][0][0]; |
|
| 1072 | + if (isset($file_info['childs']) and sizeof($file_info['childs'])) { |
|
| 1073 | + $basename = $file_info['childs'][0][0]; |
|
| 1074 | + } |
|
| 1070 | 1075 | ?> |
| 1071 | 1076 | <?php if ($this->xcloner_encryption->is_encrypted_file($basename)) :?> |
| 1072 | 1077 | <a href="#<?php echo $file_info['basename'] ?>" class="backup-decryption" |
| 1073 | 1078 | title="<?php echo __('Backup Decryption', 'xcloner-backup-and-restore') ?>"> |
| 1074 | 1079 | <i class="material-icons">enhanced_encryption</i> |
| 1075 | 1080 | </a> |
| 1076 | - <?php else: ?> |
|
| 1081 | + <?php else { |
|
| 1082 | + : ?> |
|
| 1077 | 1083 | <a href="#<?php echo $file_info['basename'] ?>" class="list-backup-content" |
| 1078 | 1084 | title="<?php echo __('List Backup Content', 'xcloner-backup-and-restore') ?>"><i |
| 1079 | 1085 | class="material-icons">folder_open</i></a> |
@@ -1083,7 +1089,9 @@ discard block |
||
| 1083 | 1089 | <i class="material-icons">no_encryption</i> |
| 1084 | 1090 | </a> |
| 1085 | 1091 | <?php endif?> |
| 1086 | - <?php endif; ?> |
|
| 1092 | + <?php endif; |
|
| 1093 | +} |
|
| 1094 | +?> |
|
| 1087 | 1095 | |
| 1088 | 1096 | <a href="#<?php echo $file_info['basename'] ?>" class="delete" |
| 1089 | 1097 | title="<?php echo __('Delete Backup', 'xcloner-backup-and-restore') ?>"> |
@@ -1137,7 +1145,7 @@ discard block |
||
| 1137 | 1145 | $tar->open($this->xcloner_settings->get_xcloner_store_path().DS.$backup_file, $start); |
| 1138 | 1146 | |
| 1139 | 1147 | $data = $tar->contents(get_option('xcloner_files_to_process_per_request')); |
| 1140 | - }catch (Exception $e) { |
|
| 1148 | + } catch (Exception $e) { |
|
| 1141 | 1149 | $return['error'] = true; |
| 1142 | 1150 | $return['message'] = $e->getMessage(); |
| 1143 | 1151 | $this->send_response($return, 0); |
@@ -1200,7 +1208,7 @@ discard block |
||
| 1200 | 1208 | "copy_backup_remote_to_local" |
| 1201 | 1209 | ), array($backup_file, $storage_type)); |
| 1202 | 1210 | } |
| 1203 | - }catch (Exception $e) { |
|
| 1211 | + } catch (Exception $e) { |
|
| 1204 | 1212 | |
| 1205 | 1213 | $return['error'] = 1; |
| 1206 | 1214 | $return['message'] = $e->getMessage(); |
@@ -1239,7 +1247,7 @@ discard block |
||
| 1239 | 1247 | "upload_backup_to_storage" |
| 1240 | 1248 | ), array($backup_file, $storage_type)); |
| 1241 | 1249 | } |
| 1242 | - }catch (Exception $e) { |
|
| 1250 | + } catch (Exception $e) { |
|
| 1243 | 1251 | |
| 1244 | 1252 | $return['error'] = 1; |
| 1245 | 1253 | $return['message'] = $e->getMessage(); |
@@ -1335,7 +1343,7 @@ discard block |
||
| 1335 | 1343 | |
| 1336 | 1344 | try { |
| 1337 | 1345 | unlink($tmp_file); |
| 1338 | - }catch (Exception $e) { |
|
| 1346 | + } catch (Exception $e) { |
|
| 1339 | 1347 | //We are not interested in the error here |
| 1340 | 1348 | } |
| 1341 | 1349 | |
@@ -1430,7 +1438,7 @@ discard block |
||
| 1430 | 1438 | $xcloner_file_transfer->set_target($target_url); |
| 1431 | 1439 | $return['start'] = $xcloner_file_transfer->transfer_file($file, $start, $hash); |
| 1432 | 1440 | |
| 1433 | - }catch (Exception $e) { |
|
| 1441 | + } catch (Exception $e) { |
|
| 1434 | 1442 | |
| 1435 | 1443 | $return = array(); |
| 1436 | 1444 | $return['error'] = true; |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | try { |
| 97 | 97 | mkdir($path); |
| 98 | 98 | chmod($path, 0777); |
| 99 | - }catch(Exception $e){ |
|
| 99 | + } catch(Exception $e){ |
|
| 100 | 100 | //silent catch |
| 101 | 101 | } |
| 102 | 102 | } |
@@ -102,7 +102,7 @@ discard block |
||
| 102 | 102 | $this->storage_filesystem_append = new Filesystem($this->storage_adapter, new Config([ |
| 103 | 103 | 'disable_asserts' => true, |
| 104 | 104 | ])); |
| 105 | - }catch (Exception $e) { |
|
| 105 | + } catch (Exception $e) { |
|
| 106 | 106 | $this->logger->error("Filesystem Initialization Error: ".$e->getMessage()); |
| 107 | 107 | } |
| 108 | 108 | |
@@ -510,7 +510,7 @@ discard block |
||
| 510 | 510 | |
| 511 | 511 | try { |
| 512 | 512 | rmdir($this->xcloner_settings->get_xcloner_tmp_path()); |
| 513 | - }catch (Exception $e) { |
|
| 513 | + } catch (Exception $e) { |
|
| 514 | 514 | //silent continue |
| 515 | 515 | } |
| 516 | 516 | |
@@ -649,7 +649,7 @@ discard block |
||
| 649 | 649 | } |
| 650 | 650 | } |
| 651 | 651 | |
| 652 | - }catch (Exception $e) { |
|
| 652 | + } catch (Exception $e) { |
|
| 653 | 653 | |
| 654 | 654 | $this->logger->error($e->getMessage()); |
| 655 | 655 | |
@@ -676,7 +676,7 @@ discard block |
||
| 676 | 676 | |
| 677 | 677 | $this->tmp_filesystem->delete($tmp_file); |
| 678 | 678 | |
| 679 | - }catch (Exception $e) { |
|
| 679 | + } catch (Exception $e) { |
|
| 680 | 680 | |
| 681 | 681 | $this->logger->error($e->getMessage()); |
| 682 | 682 | |
@@ -714,9 +714,11 @@ discard block |
||
| 714 | 714 | foreach ($_backup_files_list as $file) { |
| 715 | 715 | //processing rule folder capacity |
| 716 | 716 | if ($this->xcloner_settings->get_xcloner_option('xcloner_cleanup_capacity_limit') && |
| 717 | - $_storage_size >= ($set_storage_limit = 1024 * 1024 * $this->xcloner_settings->get_xcloner_option('xcloner_cleanup_capacity_limit'))) //bytes |
|
| 717 | + $_storage_size >= ($set_storage_limit = 1024 * 1024 * $this->xcloner_settings->get_xcloner_option('xcloner_cleanup_capacity_limit'))) { |
|
| 718 | + //bytes |
|
| 718 | 719 | { |
| 719 | 720 | $this->storage_filesystem->delete($file['path']); |
| 721 | + } |
|
| 720 | 722 | $_storage_size -= $file['size']; |
| 721 | 723 | $this->logger->info("Deleting backup ".$file['path']." matching rule", array( |
| 722 | 724 | "STORAGE SIZE LIMIT", |
@@ -983,7 +985,7 @@ discard block |
||
| 983 | 985 | if ($file['type'] == "dir") { |
| 984 | 986 | try { |
| 985 | 987 | $this->tmp_filesystem_append->write($this->get_temp_dir_handler(), $file['path']."\n"); |
| 986 | - }catch (Exception $e) { |
|
| 988 | + } catch (Exception $e) { |
|
| 987 | 989 | $this->logger->error($e->getMessage()); |
| 988 | 990 | } |
| 989 | 991 | } |
@@ -1009,7 +1011,7 @@ discard block |
||
| 1009 | 1011 | |
| 1010 | 1012 | $this->tmp_filesystem_append->write($this->get_included_files_handler(), $line); |
| 1011 | 1013 | |
| 1012 | - }catch (Exception $e) { |
|
| 1014 | + } catch (Exception $e) { |
|
| 1013 | 1015 | |
| 1014 | 1016 | $this->logger->error($e->getMessage()); |
| 1015 | 1017 | } |