@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | |
| 4 | 4 | $gdrive_auth_url = ""; |
| 5 | 5 | |
| 6 | -if(method_exists($remote_storage, "get_gdrive_auth_url")) |
|
| 6 | +if (method_exists($remote_storage, "get_gdrive_auth_url")) |
|
| 7 | 7 | $gdrive_auth_url = $remote_storage->get_gdrive_auth_url(); |
| 8 | 8 | |
| 9 | 9 | $gdrive_construct = $remote_storage->gdrive_construct(); |
@@ -20,12 +20,12 @@ discard block |
||
| 20 | 20 | <!-- FTP STORAGE--> |
| 21 | 21 | <li id="ftp"> |
| 22 | 22 | <div class="collapsible-header"> |
| 23 | - <i class="material-icons">computer</i><?php echo __("FTP Storage",'xcloner-backup-and-restore')?> |
|
| 23 | + <i class="material-icons">computer</i><?php echo __("FTP Storage", 'xcloner-backup-and-restore')?> |
|
| 24 | 24 | <div class="right"> |
| 25 | 25 | <div class="switch"> |
| 26 | 26 | <label> |
| 27 | 27 | Off |
| 28 | - <input type="checkbox" name="xcloner_ftp_enable" class="status" value="1" <?php if(get_option("xcloner_ftp_enable")) echo "checked"?> \> |
|
| 28 | + <input type="checkbox" name="xcloner_ftp_enable" class="status" value="1" <?php if (get_option("xcloner_ftp_enable")) echo "checked"?> \> |
|
| 29 | 29 | <span class="lever"></span> |
| 30 | 30 | On |
| 31 | 31 | </label> |
@@ -35,96 +35,96 @@ discard block |
||
| 35 | 35 | <div class="collapsible-body"> |
| 36 | 36 | <div class="row"> |
| 37 | 37 | <div class="col s12 m3 label"> |
| 38 | - <label for="ftp_host"><?php echo __("Ftp Hostname",'xcloner-backup-and-restore')?></label> |
|
| 38 | + <label for="ftp_host"><?php echo __("Ftp Hostname", 'xcloner-backup-and-restore')?></label> |
|
| 39 | 39 | </div> |
| 40 | 40 | <div class="col s12 m6"> |
| 41 | - <input placeholder="<?php echo __("Ftp Hostname",'xcloner-backup-and-restore')?>" id="ftp_host" type="text" name="xcloner_ftp_hostname" class="validate" value="<?php echo get_option("xcloner_ftp_hostname")?>"> |
|
| 41 | + <input placeholder="<?php echo __("Ftp Hostname", 'xcloner-backup-and-restore')?>" id="ftp_host" type="text" name="xcloner_ftp_hostname" class="validate" value="<?php echo get_option("xcloner_ftp_hostname")?>"> |
|
| 42 | 42 | </div> |
| 43 | 43 | <div class=" col s12 m2"> |
| 44 | - <input placeholder="<?php echo __("Ftp Port",'xcloner-backup-and-restore')?>" id="ftp_port" type="text" name="xcloner_ftp_port" class="validate" value="<?php echo get_option("xcloner_ftp_port", 21)?>"> |
|
| 44 | + <input placeholder="<?php echo __("Ftp Port", 'xcloner-backup-and-restore')?>" id="ftp_port" type="text" name="xcloner_ftp_port" class="validate" value="<?php echo get_option("xcloner_ftp_port", 21)?>"> |
|
| 45 | 45 | </div> |
| 46 | 46 | </div> |
| 47 | 47 | |
| 48 | 48 | <div class="row"> |
| 49 | 49 | <div class="col s12 m3 label"> |
| 50 | - <label for="ftp_username"><?php echo __("Ftp Username",'xcloner-backup-and-restore')?></label> |
|
| 50 | + <label for="ftp_username"><?php echo __("Ftp Username", 'xcloner-backup-and-restore')?></label> |
|
| 51 | 51 | </div> |
| 52 | 52 | <div class=" col s12 m6"> |
| 53 | - <input placeholder="<?php echo __("Ftp Username",'xcloner-backup-and-restore')?>" id="ftp_username" type="text" name="xcloner_ftp_username" class="validate" value="<?php echo get_option("xcloner_ftp_username")?>" autocomplete="off" > |
|
| 53 | + <input placeholder="<?php echo __("Ftp Username", 'xcloner-backup-and-restore')?>" id="ftp_username" type="text" name="xcloner_ftp_username" class="validate" value="<?php echo get_option("xcloner_ftp_username")?>" autocomplete="off" > |
|
| 54 | 54 | </div> |
| 55 | 55 | </div> |
| 56 | 56 | |
| 57 | 57 | |
| 58 | 58 | <div class="row"> |
| 59 | 59 | <div class="col s12 m3 label"> |
| 60 | - <label for="ftp_password"><?php echo __("Ftp Password",'xcloner-backup-and-restore')?></label> |
|
| 60 | + <label for="ftp_password"><?php echo __("Ftp Password", 'xcloner-backup-and-restore')?></label> |
|
| 61 | 61 | </div> |
| 62 | 62 | <div class=" col s12 m6"> |
| 63 | - <input placeholder="<?php echo __("Ftp Password",'xcloner-backup-and-restore')?>" id="ftp_password" type="password" name="xcloner_ftp_password" class="validate" value="<?php echo get_option("xcloner_ftp_password")?>" autocomplete="off" > |
|
| 63 | + <input placeholder="<?php echo __("Ftp Password", 'xcloner-backup-and-restore')?>" id="ftp_password" type="password" name="xcloner_ftp_password" class="validate" value="<?php echo get_option("xcloner_ftp_password")?>" autocomplete="off" > |
|
| 64 | 64 | </div> |
| 65 | 65 | </div> |
| 66 | 66 | |
| 67 | 67 | <div class="row"> |
| 68 | 68 | <div class="col s12 m3 label"> |
| 69 | - <label for="ftp_root"><?php echo __("Ftp Storage Folder",'xcloner-backup-and-restore')?></label> |
|
| 69 | + <label for="ftp_root"><?php echo __("Ftp Storage Folder", 'xcloner-backup-and-restore')?></label> |
|
| 70 | 70 | </div> |
| 71 | 71 | <div class=" col s12 m6"> |
| 72 | - <input placeholder="<?php echo __("Ftp Storage Folder",'xcloner-backup-and-restore')?>" id="ftp_root" type="text" name="xcloner_ftp_path" class="validate" value="<?php echo get_option("xcloner_ftp_path")?>"> |
|
| 72 | + <input placeholder="<?php echo __("Ftp Storage Folder", 'xcloner-backup-and-restore')?>" id="ftp_root" type="text" name="xcloner_ftp_path" class="validate" value="<?php echo get_option("xcloner_ftp_path")?>"> |
|
| 73 | 73 | </div> |
| 74 | 74 | </div> |
| 75 | 75 | |
| 76 | 76 | <div class="row"> |
| 77 | 77 | <div class="col s12 m3 label"> |
| 78 | - <label for="ftp_root"><?php echo __("Ftp Transfer Mode",'xcloner-backup-and-restore')?></label> |
|
| 78 | + <label for="ftp_root"><?php echo __("Ftp Transfer Mode", 'xcloner-backup-and-restore')?></label> |
|
| 79 | 79 | </div> |
| 80 | 80 | <div class=" col s12 m6 input-field inline"> |
| 81 | - <input name="xcloner_ftp_transfer_mode" type="radio" id="passive" value="1" <?php if(get_option("xcloner_ftp_transfer_mode", 1)) echo "checked"?> /> |
|
| 82 | - <label for="passive"><?php echo __("Passive",'xcloner-backup-and-restore')?></label> |
|
| 81 | + <input name="xcloner_ftp_transfer_mode" type="radio" id="passive" value="1" <?php if (get_option("xcloner_ftp_transfer_mode", 1)) echo "checked"?> /> |
|
| 82 | + <label for="passive"><?php echo __("Passive", 'xcloner-backup-and-restore')?></label> |
|
| 83 | 83 | |
| 84 | - <input name="xcloner_ftp_transfer_mode" type="radio" id="active" value="0" <?php if(!get_option("xcloner_ftp_transfer_mode", 1)) echo "checked"?> /> |
|
| 85 | - <label for="active"><?php echo __("Active",'xcloner-backup-and-restore')?></label> |
|
| 84 | + <input name="xcloner_ftp_transfer_mode" type="radio" id="active" value="0" <?php if (!get_option("xcloner_ftp_transfer_mode", 1)) echo "checked"?> /> |
|
| 85 | + <label for="active"><?php echo __("Active", 'xcloner-backup-and-restore')?></label> |
|
| 86 | 86 | </div> |
| 87 | 87 | </div> |
| 88 | 88 | |
| 89 | 89 | <div class="row"> |
| 90 | 90 | <div class="col s12 m3 label"> |
| 91 | - <label for="ftp_ssl_mode"><?php echo __("Ftp Secure Connection",'xcloner-backup-and-restore')?></label> |
|
| 91 | + <label for="ftp_ssl_mode"><?php echo __("Ftp Secure Connection", 'xcloner-backup-and-restore')?></label> |
|
| 92 | 92 | </div> |
| 93 | 93 | <div class=" col s12 m6 input-field inline"> |
| 94 | - <input name="xcloner_ftp_ssl_mode" type="radio" id="ftp_ssl_mode_inactive" value="0" <?php if(!get_option("xcloner_ftp_ssl_mode")) echo "checked"?> /> |
|
| 95 | - <label for="ftp_ssl_mode_inactive"><?php echo __("Disable",'xcloner-backup-and-restore')?></label> |
|
| 94 | + <input name="xcloner_ftp_ssl_mode" type="radio" id="ftp_ssl_mode_inactive" value="0" <?php if (!get_option("xcloner_ftp_ssl_mode")) echo "checked"?> /> |
|
| 95 | + <label for="ftp_ssl_mode_inactive"><?php echo __("Disable", 'xcloner-backup-and-restore')?></label> |
|
| 96 | 96 | |
| 97 | - <input name="xcloner_ftp_ssl_mode" type="radio" id="ftp_ssl_mode_active" value="1" <?php if(get_option("xcloner_ftp_ssl_mode")) echo "checked"?> /> |
|
| 98 | - <label for="ftp_ssl_mode_active"><?php echo __("Enable",'xcloner-backup-and-restore')?></label> |
|
| 97 | + <input name="xcloner_ftp_ssl_mode" type="radio" id="ftp_ssl_mode_active" value="1" <?php if (get_option("xcloner_ftp_ssl_mode")) echo "checked"?> /> |
|
| 98 | + <label for="ftp_ssl_mode_active"><?php echo __("Enable", 'xcloner-backup-and-restore')?></label> |
|
| 99 | 99 | </div> |
| 100 | 100 | </div> |
| 101 | 101 | |
| 102 | 102 | <div class="row"> |
| 103 | 103 | <div class="col s12 m3 label"> |
| 104 | - <label for="ftp_timeout"><?php echo __("Ftp Timeout",'xcloner-backup-and-restore')?></label> |
|
| 104 | + <label for="ftp_timeout"><?php echo __("Ftp Timeout", 'xcloner-backup-and-restore')?></label> |
|
| 105 | 105 | </div> |
| 106 | 106 | <div class=" col s12 m2"> |
| 107 | - <input placeholder="<?php echo __("Ftp Timeout",'xcloner-backup-and-restore')?>" id="ftp_timeout" type="text" name="xcloner_ftp_timeout" class="validate" value="<?php echo get_option("xcloner_ftp_timeout", 30)?>"> |
|
| 107 | + <input placeholder="<?php echo __("Ftp Timeout", 'xcloner-backup-and-restore')?>" id="ftp_timeout" type="text" name="xcloner_ftp_timeout" class="validate" value="<?php echo get_option("xcloner_ftp_timeout", 30)?>"> |
|
| 108 | 108 | </div> |
| 109 | 109 | </div> |
| 110 | 110 | |
| 111 | 111 | <div class="row"> |
| 112 | 112 | <div class="col s12 m3 label"> |
| 113 | - <label for="ftp_cleanup_days"><?php echo __("Ftp Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
| 113 | + <label for="ftp_cleanup_days"><?php echo __("Ftp Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
| 114 | 114 | </div> |
| 115 | 115 | <div class=" col s12 m6"> |
| 116 | - <input placeholder="<?php echo __("how many days to keep the backups for",'xcloner-backup-and-restore')?>" id="ftp_cleanup_days" type="text" name="xcloner_ftp_cleanup_days" class="validate" value="<?php echo get_option("xcloner_ftp_cleanup_days")?>"> |
|
| 116 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore')?>" id="ftp_cleanup_days" type="text" name="xcloner_ftp_cleanup_days" class="validate" value="<?php echo get_option("xcloner_ftp_cleanup_days")?>"> |
|
| 117 | 117 | </div> |
| 118 | 118 | </div> |
| 119 | 119 | |
| 120 | 120 | <div class="row"> |
| 121 | 121 | <div class="col s6 m4"> |
| 122 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="ftp"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
| 122 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="ftp"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
| 123 | 123 | <i class="material-icons right">save</i> |
| 124 | 124 | </button> |
| 125 | 125 | </div> |
| 126 | 126 | <div class="col s6 m4"> |
| 127 | - <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="ftp" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify",'xcloner-backup-and-restore')?> |
|
| 127 | + <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="ftp" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore')?> |
|
| 128 | 128 | <i class="material-icons right">import_export</i> |
| 129 | 129 | </button> |
| 130 | 130 | </div> |
@@ -135,12 +135,12 @@ discard block |
||
| 135 | 135 | <!-- SFTP STORAGE--> |
| 136 | 136 | <li id="sftp"> |
| 137 | 137 | <div class="collapsible-header"> |
| 138 | - <i class="material-icons">computer</i><?php echo __("SFTP Storage",'xcloner-backup-and-restore')?> |
|
| 138 | + <i class="material-icons">computer</i><?php echo __("SFTP Storage", 'xcloner-backup-and-restore')?> |
|
| 139 | 139 | <div class="right"> |
| 140 | 140 | <div class="switch"> |
| 141 | 141 | <label> |
| 142 | 142 | Off |
| 143 | - <input type="checkbox" name="xcloner_sftp_enable" class="status" value="1" <?php if(get_option("xcloner_sftp_enable")) echo "checked"?> \> |
|
| 143 | + <input type="checkbox" name="xcloner_sftp_enable" class="status" value="1" <?php if (get_option("xcloner_sftp_enable")) echo "checked"?> \> |
|
| 144 | 144 | <span class="lever"></span> |
| 145 | 145 | On |
| 146 | 146 | </label> |
@@ -150,80 +150,80 @@ discard block |
||
| 150 | 150 | <div class="collapsible-body"> |
| 151 | 151 | <div class="row"> |
| 152 | 152 | <div class="col s12 m3 label"> |
| 153 | - <label for="sftp_host"><?php echo __("SFTP Hostname",'xcloner-backup-and-restore')?></label> |
|
| 153 | + <label for="sftp_host"><?php echo __("SFTP Hostname", 'xcloner-backup-and-restore')?></label> |
|
| 154 | 154 | </div> |
| 155 | 155 | <div class="col s12 m6"> |
| 156 | - <input placeholder="<?php echo __("SFTP Hostname",'xcloner-backup-and-restore')?>" id="sftp_host" type="text" name="xcloner_sftp_hostname" class="validate" value="<?php echo get_option("xcloner_sftp_hostname")?>"> |
|
| 156 | + <input placeholder="<?php echo __("SFTP Hostname", 'xcloner-backup-and-restore')?>" id="sftp_host" type="text" name="xcloner_sftp_hostname" class="validate" value="<?php echo get_option("xcloner_sftp_hostname")?>"> |
|
| 157 | 157 | </div> |
| 158 | 158 | <div class=" col s12 m2"> |
| 159 | - <input placeholder="<?php echo __("SFTP Port",'xcloner-backup-and-restore')?>" id="sftp_port" type="text" name="xcloner_sftp_port" class="validate" value="<?php echo get_option("xcloner_sftp_port", 22)?>"> |
|
| 159 | + <input placeholder="<?php echo __("SFTP Port", 'xcloner-backup-and-restore')?>" id="sftp_port" type="text" name="xcloner_sftp_port" class="validate" value="<?php echo get_option("xcloner_sftp_port", 22)?>"> |
|
| 160 | 160 | </div> |
| 161 | 161 | </div> |
| 162 | 162 | |
| 163 | 163 | <div class="row"> |
| 164 | 164 | <div class="col s12 m3 label"> |
| 165 | - <label for="sftp_username"><?php echo __("SFTP Username",'xcloner-backup-and-restore')?></label> |
|
| 165 | + <label for="sftp_username"><?php echo __("SFTP Username", 'xcloner-backup-and-restore')?></label> |
|
| 166 | 166 | </div> |
| 167 | 167 | <div class=" col s12 m6"> |
| 168 | - <input placeholder="<?php echo __("SFTP Username",'xcloner-backup-and-restore')?>" id="sftp_username" type="text" name="xcloner_sftp_username" class="validate" value="<?php echo get_option("xcloner_sftp_username")?>" autocomplete="off" > |
|
| 168 | + <input placeholder="<?php echo __("SFTP Username", 'xcloner-backup-and-restore')?>" id="sftp_username" type="text" name="xcloner_sftp_username" class="validate" value="<?php echo get_option("xcloner_sftp_username")?>" autocomplete="off" > |
|
| 169 | 169 | </div> |
| 170 | 170 | </div> |
| 171 | 171 | |
| 172 | 172 | |
| 173 | 173 | <div class="row"> |
| 174 | 174 | <div class="col s12 m3 label"> |
| 175 | - <label for="sftp_password"><?php echo __("SFTP Password",'xcloner-backup-and-restore')?></label> |
|
| 175 | + <label for="sftp_password"><?php echo __("SFTP Password", 'xcloner-backup-and-restore')?></label> |
|
| 176 | 176 | </div> |
| 177 | 177 | <div class=" col s12 m6"> |
| 178 | - <input placeholder="<?php echo __("SFTP Password",'xcloner-backup-and-restore')?>" id="ftp_spassword" type="password" name="xcloner_sftp_password" class="validate" value="<?php echo get_option("xcloner_sftp_password")?>" autocomplete="off" > |
|
| 178 | + <input placeholder="<?php echo __("SFTP Password", 'xcloner-backup-and-restore')?>" id="ftp_spassword" type="password" name="xcloner_sftp_password" class="validate" value="<?php echo get_option("xcloner_sftp_password")?>" autocomplete="off" > |
|
| 179 | 179 | </div> |
| 180 | 180 | </div> |
| 181 | 181 | |
| 182 | 182 | <div class="row"> |
| 183 | 183 | <div class="col s12 m3 label"> |
| 184 | - <label for="sftp_private_key"><?php echo __("SFTP Private Key",'xcloner-backup-and-restore')?></label> |
|
| 184 | + <label for="sftp_private_key"><?php echo __("SFTP Private Key", 'xcloner-backup-and-restore')?></label> |
|
| 185 | 185 | </div> |
| 186 | 186 | <div class=" col s12 m6"> |
| 187 | - <textarea rows="5" placeholder="<?php echo __("Local Server Path or Contents of the SFTP Private Key File",'xcloner-backup-and-restore')?>" id="sftp_private_key" type="text" name="xcloner_sftp_private_key" class="validate" value=""><?php echo get_option("xcloner_sftp_private_key")?> |
|
| 187 | + <textarea rows="5" placeholder="<?php echo __("Local Server Path or Contents of the SFTP Private Key File", 'xcloner-backup-and-restore')?>" id="sftp_private_key" type="text" name="xcloner_sftp_private_key" class="validate" value=""><?php echo get_option("xcloner_sftp_private_key")?> |
|
| 188 | 188 | </textarea> |
| 189 | 189 | </div> |
| 190 | 190 | </div> |
| 191 | 191 | |
| 192 | 192 | <div class="row"> |
| 193 | 193 | <div class="col s12 m3 label"> |
| 194 | - <label for="sftp_root"><?php echo __("SFTP Storage Folder",'xcloner-backup-and-restore')?></label> |
|
| 194 | + <label for="sftp_root"><?php echo __("SFTP Storage Folder", 'xcloner-backup-and-restore')?></label> |
|
| 195 | 195 | </div> |
| 196 | 196 | <div class=" col s12 m6"> |
| 197 | - <input placeholder="<?php echo __("SFTP Storage Folder",'xcloner-backup-and-restore')?>" id="sftp_root" type="text" name="xcloner_sftp_path" class="validate" value="<?php echo get_option("xcloner_sftp_path")?>"> |
|
| 197 | + <input placeholder="<?php echo __("SFTP Storage Folder", 'xcloner-backup-and-restore')?>" id="sftp_root" type="text" name="xcloner_sftp_path" class="validate" value="<?php echo get_option("xcloner_sftp_path")?>"> |
|
| 198 | 198 | </div> |
| 199 | 199 | </div> |
| 200 | 200 | |
| 201 | 201 | <div class="row"> |
| 202 | 202 | <div class="col s12 m3 label"> |
| 203 | - <label for="sftp_timeout"><?php echo __("SFTP Timeout",'xcloner-backup-and-restore')?></label> |
|
| 203 | + <label for="sftp_timeout"><?php echo __("SFTP Timeout", 'xcloner-backup-and-restore')?></label> |
|
| 204 | 204 | </div> |
| 205 | 205 | <div class=" col s12 m2"> |
| 206 | - <input placeholder="<?php echo __("SFTP Timeout",'xcloner-backup-and-restore')?>" id="sftp_timeout" type="text" name="xcloner_sftp_timeout" class="validate" value="<?php echo get_option("xcloner_sftp_timeout", 30)?>"> |
|
| 206 | + <input placeholder="<?php echo __("SFTP Timeout", 'xcloner-backup-and-restore')?>" id="sftp_timeout" type="text" name="xcloner_sftp_timeout" class="validate" value="<?php echo get_option("xcloner_sftp_timeout", 30)?>"> |
|
| 207 | 207 | </div> |
| 208 | 208 | </div> |
| 209 | 209 | |
| 210 | 210 | <div class="row"> |
| 211 | 211 | <div class="col s12 m3 label"> |
| 212 | - <label for="sftp_cleanup_days"><?php echo __("SFTP Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
| 212 | + <label for="sftp_cleanup_days"><?php echo __("SFTP Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
| 213 | 213 | </div> |
| 214 | 214 | <div class=" col s12 m6"> |
| 215 | - <input placeholder="<?php echo __("how many days to keep the backups for",'xcloner-backup-and-restore')?>" id="sftp_cleanup_days" type="text" name="xcloner_sftp_cleanup_days" class="validate" value="<?php echo get_option("xcloner_sftp_cleanup_days")?>"> |
|
| 215 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore')?>" id="sftp_cleanup_days" type="text" name="xcloner_sftp_cleanup_days" class="validate" value="<?php echo get_option("xcloner_sftp_cleanup_days")?>"> |
|
| 216 | 216 | </div> |
| 217 | 217 | </div> |
| 218 | 218 | |
| 219 | 219 | <div class="row"> |
| 220 | 220 | <div class="col s6 m4"> |
| 221 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="sftp"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
| 221 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="sftp"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
| 222 | 222 | <i class="material-icons right">save</i> |
| 223 | 223 | </button> |
| 224 | 224 | </div> |
| 225 | 225 | <div class="col s6 m4"> |
| 226 | - <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="sftp" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify",'xcloner-backup-and-restore')?> |
|
| 226 | + <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="sftp" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore')?> |
|
| 227 | 227 | <i class="material-icons right">import_export</i> |
| 228 | 228 | </button> |
| 229 | 229 | </div> |
@@ -235,12 +235,12 @@ discard block |
||
| 235 | 235 | <!-- AWS STORAGE--> |
| 236 | 236 | <li id="aws"> |
| 237 | 237 | <div class="collapsible-header"> |
| 238 | - <i class="material-icons">computer</i><?php echo __("AWS Storage",'xcloner-backup-and-restore')?> |
|
| 238 | + <i class="material-icons">computer</i><?php echo __("AWS Storage", 'xcloner-backup-and-restore')?> |
|
| 239 | 239 | <div class="right"> |
| 240 | 240 | <div class="switch"> |
| 241 | 241 | <label> |
| 242 | 242 | Off |
| 243 | - <input type="checkbox" name="xcloner_aws_enable" class="status" value="1" <?php if(get_option("xcloner_aws_enable")) echo "checked"?> \> |
|
| 243 | + <input type="checkbox" name="xcloner_aws_enable" class="status" value="1" <?php if (get_option("xcloner_aws_enable")) echo "checked"?> \> |
|
| 244 | 244 | <span class="lever"></span> |
| 245 | 245 | On |
| 246 | 246 | </label> |
@@ -262,35 +262,35 @@ discard block |
||
| 262 | 262 | |
| 263 | 263 | <div class="row"> |
| 264 | 264 | <div class="col s12 m3 label"> |
| 265 | - <label for="aws_key"><?php echo __("AWS Key",'xcloner-backup-and-restore')?></label> |
|
| 265 | + <label for="aws_key"><?php echo __("AWS Key", 'xcloner-backup-and-restore')?></label> |
|
| 266 | 266 | </div> |
| 267 | 267 | <div class=" col s12 m6"> |
| 268 | - <input placeholder="<?php echo __("AWS Key",'xcloner-backup-and-restore')?>" id="aws_key" type="text" name="xcloner_aws_key" class="validate" value="<?php echo get_option("xcloner_aws_key")?>" autocomplete="off" > |
|
| 268 | + <input placeholder="<?php echo __("AWS Key", 'xcloner-backup-and-restore')?>" id="aws_key" type="text" name="xcloner_aws_key" class="validate" value="<?php echo get_option("xcloner_aws_key")?>" autocomplete="off" > |
|
| 269 | 269 | </div> |
| 270 | 270 | </div> |
| 271 | 271 | |
| 272 | 272 | <div class="row"> |
| 273 | 273 | <div class="col s12 m3 label"> |
| 274 | - <label for="aws_secret"><?php echo __("AWS Secret",'xcloner-backup-and-restore')?></label> |
|
| 274 | + <label for="aws_secret"><?php echo __("AWS Secret", 'xcloner-backup-and-restore')?></label> |
|
| 275 | 275 | </div> |
| 276 | 276 | <div class=" col s12 m6"> |
| 277 | - <input placeholder="<?php echo __("AWS Secret",'xcloner-backup-and-restore')?>" id="aws_secret" type="text" name="xcloner_aws_secret" class="validate" value="<?php echo get_option("xcloner_aws_secret")?>" autocomplete="off" > |
|
| 277 | + <input placeholder="<?php echo __("AWS Secret", 'xcloner-backup-and-restore')?>" id="aws_secret" type="text" name="xcloner_aws_secret" class="validate" value="<?php echo get_option("xcloner_aws_secret")?>" autocomplete="off" > |
|
| 278 | 278 | </div> |
| 279 | 279 | </div> |
| 280 | 280 | |
| 281 | 281 | <div class="row"> |
| 282 | 282 | <div class="col s12 m3 label"> |
| 283 | - <label for="aws_region"><?php echo __("AWS Region",'xcloner-backup-and-restore')?></label> |
|
| 283 | + <label for="aws_region"><?php echo __("AWS Region", 'xcloner-backup-and-restore')?></label> |
|
| 284 | 284 | </div> |
| 285 | 285 | <div class=" col s12 m6"> |
| 286 | - <select placeholder="<?php echo __("example: us-east-1",'xcloner-backup-and-restore')?>" id="aws_region" type="text" name="xcloner_aws_region" class="validate" value="<?php echo get_option("xcloner_aws_region")?>" autocomplete="off" > |
|
| 286 | + <select placeholder="<?php echo __("example: us-east-1", 'xcloner-backup-and-restore')?>" id="aws_region" type="text" name="xcloner_aws_region" class="validate" value="<?php echo get_option("xcloner_aws_region")?>" autocomplete="off" > |
|
| 287 | 287 | <option readonly value=""><?php echo __("Please Select AWS Region")?></option> |
| 288 | 288 | <?php |
| 289 | 289 | $aws_regions = $remote_storage->get_aws_regions(); |
| 290 | 290 | |
| 291 | - foreach($aws_regions as $key=>$region){ |
|
| 291 | + foreach ($aws_regions as $key=>$region) { |
|
| 292 | 292 | ?> |
| 293 | - <option value="<?php echo $key?>" <?php echo ($key == get_option('xcloner_aws_region')?"selected":"")?>><?php echo $region?> = <?php echo $key?></option> |
|
| 293 | + <option value="<?php echo $key?>" <?php echo ($key == get_option('xcloner_aws_region') ? "selected" : "")?>><?php echo $region?> = <?php echo $key?></option> |
|
| 294 | 294 | <?php |
| 295 | 295 | } |
| 296 | 296 | ?> |
@@ -300,30 +300,30 @@ discard block |
||
| 300 | 300 | |
| 301 | 301 | <div class="row"> |
| 302 | 302 | <div class="col s12 m3 label"> |
| 303 | - <label for="aws_bucket_name"><?php echo __("AWS Bucket Name",'xcloner-backup-and-restore')?></label> |
|
| 303 | + <label for="aws_bucket_name"><?php echo __("AWS Bucket Name", 'xcloner-backup-and-restore')?></label> |
|
| 304 | 304 | </div> |
| 305 | 305 | <div class=" col s12 m6"> |
| 306 | - <input placeholder="<?php echo __("AWS Bucket Name",'xcloner-backup-and-restore')?>" id="aws_bucket_name" type="text" name="xcloner_aws_bucket_name" class="validate" value="<?php echo get_option("xcloner_aws_bucket_name")?>" autocomplete="off" > |
|
| 306 | + <input placeholder="<?php echo __("AWS Bucket Name", 'xcloner-backup-and-restore')?>" id="aws_bucket_name" type="text" name="xcloner_aws_bucket_name" class="validate" value="<?php echo get_option("xcloner_aws_bucket_name")?>" autocomplete="off" > |
|
| 307 | 307 | </div> |
| 308 | 308 | </div> |
| 309 | 309 | |
| 310 | 310 | <div class="row"> |
| 311 | 311 | <div class="col s12 m3 label"> |
| 312 | - <label for="aws_cleanup_days"><?php echo __("AWS Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
| 312 | + <label for="aws_cleanup_days"><?php echo __("AWS Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
| 313 | 313 | </div> |
| 314 | 314 | <div class=" col s12 m6"> |
| 315 | - <input placeholder="<?php echo __("how many days to keep the backups for",'xcloner-backup-and-restore')?>" id="aws_cleanup_days" type="text" name="xcloner_aws_cleanup_days" class="validate" value="<?php echo get_option("xcloner_aws_cleanup_days")?>"> |
|
| 315 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore')?>" id="aws_cleanup_days" type="text" name="xcloner_aws_cleanup_days" class="validate" value="<?php echo get_option("xcloner_aws_cleanup_days")?>"> |
|
| 316 | 316 | </div> |
| 317 | 317 | </div> |
| 318 | 318 | |
| 319 | 319 | <div class="row"> |
| 320 | 320 | <div class="col s6 m4"> |
| 321 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="aws"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
| 321 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="aws"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
| 322 | 322 | <i class="material-icons right">save</i> |
| 323 | 323 | </button> |
| 324 | 324 | </div> |
| 325 | 325 | <div class="col s6 m4"> |
| 326 | - <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="aws" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify",'xcloner-backup-and-restore')?> |
|
| 326 | + <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="aws" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore')?> |
|
| 327 | 327 | <i class="material-icons right">import_export</i> |
| 328 | 328 | </button> |
| 329 | 329 | </div> |
@@ -335,12 +335,12 @@ discard block |
||
| 335 | 335 | <!-- DROPBOX STORAGE--> |
| 336 | 336 | <li id="dropbox"> |
| 337 | 337 | <div class="collapsible-header"> |
| 338 | - <i class="material-icons">computer</i><?php echo __("Dropbox Storage",'xcloner-backup-and-restore')?> |
|
| 338 | + <i class="material-icons">computer</i><?php echo __("Dropbox Storage", 'xcloner-backup-and-restore')?> |
|
| 339 | 339 | <div class="right"> |
| 340 | 340 | <div class="switch"> |
| 341 | 341 | <label> |
| 342 | 342 | Off |
| 343 | - <input type="checkbox" name="xcloner_dropbox_enable" class="status" value="1" <?php if(get_option("xcloner_dropbox_enable")) echo "checked"?> \> |
|
| 343 | + <input type="checkbox" name="xcloner_dropbox_enable" class="status" value="1" <?php if (get_option("xcloner_dropbox_enable")) echo "checked"?> \> |
|
| 344 | 344 | <span class="lever"></span> |
| 345 | 345 | On |
| 346 | 346 | </label> |
@@ -362,49 +362,49 @@ discard block |
||
| 362 | 362 | |
| 363 | 363 | <div class="row"> |
| 364 | 364 | <div class="col s12 m3 label"> |
| 365 | - <label for="dropbox_access_token"><?php echo __("Dropbox Access Token",'xcloner-backup-and-restore')?></label> |
|
| 365 | + <label for="dropbox_access_token"><?php echo __("Dropbox Access Token", 'xcloner-backup-and-restore')?></label> |
|
| 366 | 366 | </div> |
| 367 | 367 | <div class=" col s12 m6"> |
| 368 | - <input placeholder="<?php echo __("Dropbox Access Token",'xcloner-backup-and-restore')?>" id="dropbox_access_token" type="text" name="xcloner_dropbox_access_token" class="validate" value="<?php echo get_option("xcloner_dropbox_access_token")?>" autocomplete="off" > |
|
| 368 | + <input placeholder="<?php echo __("Dropbox Access Token", 'xcloner-backup-and-restore')?>" id="dropbox_access_token" type="text" name="xcloner_dropbox_access_token" class="validate" value="<?php echo get_option("xcloner_dropbox_access_token")?>" autocomplete="off" > |
|
| 369 | 369 | </div> |
| 370 | 370 | </div> |
| 371 | 371 | |
| 372 | 372 | |
| 373 | 373 | <div class="row"> |
| 374 | 374 | <div class="col s12 m3 label"> |
| 375 | - <label for="dropbox_app_secret"><?php echo __("Dropbox App Secret",'xcloner-backup-and-restore')?></label> |
|
| 375 | + <label for="dropbox_app_secret"><?php echo __("Dropbox App Secret", 'xcloner-backup-and-restore')?></label> |
|
| 376 | 376 | </div> |
| 377 | 377 | <div class=" col s12 m6"> |
| 378 | - <input placeholder="<?php echo __("Dropbox App Secret",'xcloner-backup-and-restore')?>" id="dropbox_app_secret" type="text" name="xcloner_dropbox_app_secret" class="validate" value="<?php echo get_option("xcloner_dropbox_app_secret")?>" autocomplete="off" > |
|
| 378 | + <input placeholder="<?php echo __("Dropbox App Secret", 'xcloner-backup-and-restore')?>" id="dropbox_app_secret" type="text" name="xcloner_dropbox_app_secret" class="validate" value="<?php echo get_option("xcloner_dropbox_app_secret")?>" autocomplete="off" > |
|
| 379 | 379 | </div> |
| 380 | 380 | </div> |
| 381 | 381 | |
| 382 | 382 | <div class="row"> |
| 383 | 383 | <div class="col s12 m3 label"> |
| 384 | - <label for="dropbox_prefix"><?php echo __("Dropbox Prefix",'xcloner-backup-and-restore')?></label> |
|
| 384 | + <label for="dropbox_prefix"><?php echo __("Dropbox Prefix", 'xcloner-backup-and-restore')?></label> |
|
| 385 | 385 | </div> |
| 386 | 386 | <div class=" col s12 m6"> |
| 387 | - <input placeholder="<?php echo __("Dropbox Prefix",'xcloner-backup-and-restore')?>" id="dropbox_prefix" type="text" name="xcloner_dropbox_prefix" class="validate" value="<?php echo get_option("xcloner_dropbox_prefix")?>"> |
|
| 387 | + <input placeholder="<?php echo __("Dropbox Prefix", 'xcloner-backup-and-restore')?>" id="dropbox_prefix" type="text" name="xcloner_dropbox_prefix" class="validate" value="<?php echo get_option("xcloner_dropbox_prefix")?>"> |
|
| 388 | 388 | </div> |
| 389 | 389 | </div> |
| 390 | 390 | |
| 391 | 391 | <div class="row"> |
| 392 | 392 | <div class="col s12 m3 label"> |
| 393 | - <label for="dropbox_cleanup_days"><?php echo __("Dropbox Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
| 393 | + <label for="dropbox_cleanup_days"><?php echo __("Dropbox Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
| 394 | 394 | </div> |
| 395 | 395 | <div class=" col s12 m6"> |
| 396 | - <input placeholder="<?php echo __("how many days to keep the backups for",'xcloner-backup-and-restore')?>" id="dropbox_cleanup_days" type="text" name="xcloner_dropbox_cleanup_days" class="validate" value="<?php echo get_option("xcloner_dropbox_cleanup_days")?>"> |
|
| 396 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore')?>" id="dropbox_cleanup_days" type="text" name="xcloner_dropbox_cleanup_days" class="validate" value="<?php echo get_option("xcloner_dropbox_cleanup_days")?>"> |
|
| 397 | 397 | </div> |
| 398 | 398 | </div> |
| 399 | 399 | |
| 400 | 400 | <div class="row"> |
| 401 | 401 | <div class="col s6 m4"> |
| 402 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="dropbox"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
| 402 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="dropbox"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
| 403 | 403 | <i class="material-icons right">save</i> |
| 404 | 404 | </button> |
| 405 | 405 | </div> |
| 406 | 406 | <div class="col s6 m4"> |
| 407 | - <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="dropbox" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify",'xcloner-backup-and-restore')?> |
|
| 407 | + <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="dropbox" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore')?> |
|
| 408 | 408 | <i class="material-icons right">import_export</i> |
| 409 | 409 | </button> |
| 410 | 410 | </div> |
@@ -416,12 +416,12 @@ discard block |
||
| 416 | 416 | <!-- AZURE STORAGE--> |
| 417 | 417 | <li id="azure"> |
| 418 | 418 | <div class="collapsible-header"> |
| 419 | - <i class="material-icons">computer</i><?php echo __("Azure Blog Storage",'xcloner-backup-and-restore')?> |
|
| 419 | + <i class="material-icons">computer</i><?php echo __("Azure Blog Storage", 'xcloner-backup-and-restore')?> |
|
| 420 | 420 | <div class="right"> |
| 421 | 421 | <div class="switch"> |
| 422 | 422 | <label> |
| 423 | 423 | Off |
| 424 | - <input type="checkbox" name="xcloner_azure_enable" class="status" value="1" <?php if(get_option("xcloner_azure_enable")) echo "checked"?> \> |
|
| 424 | + <input type="checkbox" name="xcloner_azure_enable" class="status" value="1" <?php if (get_option("xcloner_azure_enable")) echo "checked"?> \> |
|
| 425 | 425 | <span class="lever"></span> |
| 426 | 426 | On |
| 427 | 427 | </label> |
@@ -436,56 +436,56 @@ discard block |
||
| 436 | 436 | </div> |
| 437 | 437 | <div class=" col s12 m6"> |
| 438 | 438 | <p> |
| 439 | - <?php echo sprintf(__('Visit %s and get your "Api Key".','xcloner-backup-and-restore'), '<a href="https://azure.microsoft.com/en-us/services/storage/blobs/" target="_blank">https://azure.microsoft.com/en-us/services/storage/blobs/</a>')?> |
|
| 439 | + <?php echo sprintf(__('Visit %s and get your "Api Key".', 'xcloner-backup-and-restore'), '<a href="https://azure.microsoft.com/en-us/services/storage/blobs/" target="_blank">https://azure.microsoft.com/en-us/services/storage/blobs/</a>')?> |
|
| 440 | 440 | </p> |
| 441 | 441 | </div> |
| 442 | 442 | </div> |
| 443 | 443 | |
| 444 | 444 | <div class="row"> |
| 445 | 445 | <div class="col s12 m3 label"> |
| 446 | - <label for="azure_account_name"><?php echo __("Azure Account Name",'xcloner-backup-and-restore')?></label> |
|
| 446 | + <label for="azure_account_name"><?php echo __("Azure Account Name", 'xcloner-backup-and-restore')?></label> |
|
| 447 | 447 | </div> |
| 448 | 448 | <div class=" col s12 m6"> |
| 449 | - <input placeholder="<?php echo __("Azure Account Name",'xcloner-backup-and-restore')?>" id="azure_account_name" type="text" name="xcloner_azure_account_name" class="validate" value="<?php echo get_option("xcloner_azure_account_name")?>" autocomplete="off" > |
|
| 449 | + <input placeholder="<?php echo __("Azure Account Name", 'xcloner-backup-and-restore')?>" id="azure_account_name" type="text" name="xcloner_azure_account_name" class="validate" value="<?php echo get_option("xcloner_azure_account_name")?>" autocomplete="off" > |
|
| 450 | 450 | </div> |
| 451 | 451 | </div> |
| 452 | 452 | |
| 453 | 453 | |
| 454 | 454 | <div class="row"> |
| 455 | 455 | <div class="col s12 m3 label"> |
| 456 | - <label for="azure_api_key"><?php echo __("Azure Api Key",'xcloner-backup-and-restore')?></label> |
|
| 456 | + <label for="azure_api_key"><?php echo __("Azure Api Key", 'xcloner-backup-and-restore')?></label> |
|
| 457 | 457 | </div> |
| 458 | 458 | <div class=" col s12 m6"> |
| 459 | - <input placeholder="<?php echo __("Azure Api Key",'xcloner-backup-and-restore')?>" id="azure_api_key" type="text" name="xcloner_azure_api_key" class="validate" value="<?php echo get_option("xcloner_azure_api_key")?>" autocomplete="off" > |
|
| 459 | + <input placeholder="<?php echo __("Azure Api Key", 'xcloner-backup-and-restore')?>" id="azure_api_key" type="text" name="xcloner_azure_api_key" class="validate" value="<?php echo get_option("xcloner_azure_api_key")?>" autocomplete="off" > |
|
| 460 | 460 | </div> |
| 461 | 461 | </div> |
| 462 | 462 | |
| 463 | 463 | <div class="row"> |
| 464 | 464 | <div class="col s12 m3 label"> |
| 465 | - <label for="azure_container"><?php echo __("Azure Container",'xcloner-backup-and-restore')?></label> |
|
| 465 | + <label for="azure_container"><?php echo __("Azure Container", 'xcloner-backup-and-restore')?></label> |
|
| 466 | 466 | </div> |
| 467 | 467 | <div class=" col s12 m6"> |
| 468 | - <input placeholder="<?php echo __("Azure Container",'xcloner-backup-and-restore')?>" id="azure_container" type="text" name="xcloner_azure_container" class="validate" value="<?php echo get_option("xcloner_azure_container")?>"> |
|
| 468 | + <input placeholder="<?php echo __("Azure Container", 'xcloner-backup-and-restore')?>" id="azure_container" type="text" name="xcloner_azure_container" class="validate" value="<?php echo get_option("xcloner_azure_container")?>"> |
|
| 469 | 469 | </div> |
| 470 | 470 | </div> |
| 471 | 471 | |
| 472 | 472 | <div class="row"> |
| 473 | 473 | <div class="col s12 m3 label"> |
| 474 | - <label for="azure_cleanup_days"><?php echo __("Azure Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
| 474 | + <label for="azure_cleanup_days"><?php echo __("Azure Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
| 475 | 475 | </div> |
| 476 | 476 | <div class=" col s12 m6"> |
| 477 | - <input placeholder="<?php echo __("how many days to keep the backups for",'xcloner-backup-and-restore')?>" id="azure_cleanup_days" type="text" name="xcloner_azure_cleanup_days" class="validate" value="<?php echo get_option("xcloner_azure_cleanup_days")?>"> |
|
| 477 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore')?>" id="azure_cleanup_days" type="text" name="xcloner_azure_cleanup_days" class="validate" value="<?php echo get_option("xcloner_azure_cleanup_days")?>"> |
|
| 478 | 478 | </div> |
| 479 | 479 | </div> |
| 480 | 480 | |
| 481 | 481 | <div class="row"> |
| 482 | 482 | <div class="col s6 m4"> |
| 483 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="azure"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
| 483 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="azure"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
| 484 | 484 | <i class="material-icons right">save</i> |
| 485 | 485 | </button> |
| 486 | 486 | </div> |
| 487 | 487 | <div class="col s6 m4"> |
| 488 | - <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="azure" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify",'xcloner-backup-and-restore')?> |
|
| 488 | + <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="azure" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore')?> |
|
| 489 | 489 | <i class="material-icons right">import_export</i> |
| 490 | 490 | </button> |
| 491 | 491 | </div> |
@@ -497,12 +497,12 @@ discard block |
||
| 497 | 497 | <!-- BACKBLAZE STORAGE--> |
| 498 | 498 | <li id="backblaze"> |
| 499 | 499 | <div class="collapsible-header"> |
| 500 | - <i class="material-icons">computer</i><?php echo __("BackBlaze Storage",'xcloner-backup-and-restore')?> |
|
| 500 | + <i class="material-icons">computer</i><?php echo __("BackBlaze Storage", 'xcloner-backup-and-restore')?> |
|
| 501 | 501 | <div class="right"> |
| 502 | 502 | <div class="switch"> |
| 503 | 503 | <label> |
| 504 | 504 | Off |
| 505 | - <input type="checkbox" name="xcloner_backblaze_enable" class="status" value="1" <?php if(get_option("xcloner_backblaze_enable")) echo "checked"?> \> |
|
| 505 | + <input type="checkbox" name="xcloner_backblaze_enable" class="status" value="1" <?php if (get_option("xcloner_backblaze_enable")) echo "checked"?> \> |
|
| 506 | 506 | <span class="lever"></span> |
| 507 | 507 | On |
| 508 | 508 | </label> |
@@ -517,56 +517,56 @@ discard block |
||
| 517 | 517 | </div> |
| 518 | 518 | <div class=" col s12 m6"> |
| 519 | 519 | <p> |
| 520 | - <?php echo sprintf(__('Visit %s and get your Account Id and Application Key.','xcloner-backup-and-restore'), '<a href="https://secure.backblaze.com/b2_buckets.htm" target="_blank">https://secure.backblaze.com/b2_buckets.htm</a>')?> |
|
| 520 | + <?php echo sprintf(__('Visit %s and get your Account Id and Application Key.', 'xcloner-backup-and-restore'), '<a href="https://secure.backblaze.com/b2_buckets.htm" target="_blank">https://secure.backblaze.com/b2_buckets.htm</a>')?> |
|
| 521 | 521 | </p> |
| 522 | 522 | </div> |
| 523 | 523 | </div> |
| 524 | 524 | |
| 525 | 525 | <div class="row"> |
| 526 | 526 | <div class="col s12 m3 label"> |
| 527 | - <label for="backblaze_account_id"><?php echo __("BackBlaze Account Id",'xcloner-backup-and-restore')?></label> |
|
| 527 | + <label for="backblaze_account_id"><?php echo __("BackBlaze Account Id", 'xcloner-backup-and-restore')?></label> |
|
| 528 | 528 | </div> |
| 529 | 529 | <div class=" col s12 m6"> |
| 530 | - <input placeholder="<?php echo __("BackBlaze Account Id",'xcloner-backup-and-restore')?>" id="backblaze_account_id" type="text" name="xcloner_backblaze_account_id" class="validate" value="<?php echo get_option("xcloner_backblaze_account_id")?>" autocomplete="off" > |
|
| 530 | + <input placeholder="<?php echo __("BackBlaze Account Id", 'xcloner-backup-and-restore')?>" id="backblaze_account_id" type="text" name="xcloner_backblaze_account_id" class="validate" value="<?php echo get_option("xcloner_backblaze_account_id")?>" autocomplete="off" > |
|
| 531 | 531 | </div> |
| 532 | 532 | </div> |
| 533 | 533 | |
| 534 | 534 | |
| 535 | 535 | <div class="row"> |
| 536 | 536 | <div class="col s12 m3 label"> |
| 537 | - <label for="backblaze_application_key"><?php echo __("BackBlaze Application Key",'xcloner-backup-and-restore')?></label> |
|
| 537 | + <label for="backblaze_application_key"><?php echo __("BackBlaze Application Key", 'xcloner-backup-and-restore')?></label> |
|
| 538 | 538 | </div> |
| 539 | 539 | <div class=" col s12 m6"> |
| 540 | - <input placeholder="<?php echo __("BackBlaze Application Key",'xcloner-backup-and-restore')?>" id="backblaze_application_key" type="text" name="xcloner_backblaze_application_key" class="validate" value="<?php echo get_option("xcloner_backblaze_application_key")?>" autocomplete="off" > |
|
| 540 | + <input placeholder="<?php echo __("BackBlaze Application Key", 'xcloner-backup-and-restore')?>" id="backblaze_application_key" type="text" name="xcloner_backblaze_application_key" class="validate" value="<?php echo get_option("xcloner_backblaze_application_key")?>" autocomplete="off" > |
|
| 541 | 541 | </div> |
| 542 | 542 | </div> |
| 543 | 543 | |
| 544 | 544 | <div class="row"> |
| 545 | 545 | <div class="col s12 m3 label"> |
| 546 | - <label for="backblaze_bucket_name"><?php echo __("BackBlaze Bucket Name",'xcloner-backup-and-restore')?></label> |
|
| 546 | + <label for="backblaze_bucket_name"><?php echo __("BackBlaze Bucket Name", 'xcloner-backup-and-restore')?></label> |
|
| 547 | 547 | </div> |
| 548 | 548 | <div class=" col s12 m6"> |
| 549 | - <input placeholder="<?php echo __("BackBlaze Bucket Name",'xcloner-backup-and-restore')?>" id="backblaze_bucket_name" type="text" name="xcloner_backblaze_bucket_name" class="validate" value="<?php echo get_option("xcloner_backblaze_bucket_name")?>" autocomplete="off" > |
|
| 549 | + <input placeholder="<?php echo __("BackBlaze Bucket Name", 'xcloner-backup-and-restore')?>" id="backblaze_bucket_name" type="text" name="xcloner_backblaze_bucket_name" class="validate" value="<?php echo get_option("xcloner_backblaze_bucket_name")?>" autocomplete="off" > |
|
| 550 | 550 | </div> |
| 551 | 551 | </div> |
| 552 | 552 | |
| 553 | 553 | <div class="row"> |
| 554 | 554 | <div class="col s12 m3 label"> |
| 555 | - <label for="backblaze_cleanup_days"><?php echo __("BackBlaze Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
| 555 | + <label for="backblaze_cleanup_days"><?php echo __("BackBlaze Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
| 556 | 556 | </div> |
| 557 | 557 | <div class=" col s12 m6"> |
| 558 | - <input placeholder="<?php echo __("how many days to keep the backups for",'xcloner-backup-and-restore')?>" id="backblaze_cleanup_days" type="text" name="xcloner_backblaze_cleanup_days" class="validate" value="<?php echo get_option("xcloner_backblaze_cleanup_days")?>"> |
|
| 558 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore')?>" id="backblaze_cleanup_days" type="text" name="xcloner_backblaze_cleanup_days" class="validate" value="<?php echo get_option("xcloner_backblaze_cleanup_days")?>"> |
|
| 559 | 559 | </div> |
| 560 | 560 | </div> |
| 561 | 561 | |
| 562 | 562 | <div class="row"> |
| 563 | 563 | <div class="col s6 m4"> |
| 564 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="backblaze"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
| 564 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="backblaze"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
| 565 | 565 | <i class="material-icons right">save</i> |
| 566 | 566 | </button> |
| 567 | 567 | </div> |
| 568 | 568 | <div class="col s6 m4"> |
| 569 | - <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="backblaze" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify",'xcloner-backup-and-restore')?> |
|
| 569 | + <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="backblaze" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore')?> |
|
| 570 | 570 | <i class="material-icons right">import_export</i> |
| 571 | 571 | </button> |
| 572 | 572 | </div> |
@@ -578,12 +578,12 @@ discard block |
||
| 578 | 578 | <!-- WEBDAV STORAGE--> |
| 579 | 579 | <li id="webdav"> |
| 580 | 580 | <div class="collapsible-header"> |
| 581 | - <i class="material-icons">computer</i><?php echo __("WebDAV Storage",'xcloner-backup-and-restore')?> |
|
| 581 | + <i class="material-icons">computer</i><?php echo __("WebDAV Storage", 'xcloner-backup-and-restore')?> |
|
| 582 | 582 | <div class="right"> |
| 583 | 583 | <div class="switch"> |
| 584 | 584 | <label> |
| 585 | 585 | Off |
| 586 | - <input type="checkbox" name="xcloner_webdav_enable" class="status" value="1" <?php if(get_option("xcloner_webdav_enable")) echo "checked"?> \> |
|
| 586 | + <input type="checkbox" name="xcloner_webdav_enable" class="status" value="1" <?php if (get_option("xcloner_webdav_enable")) echo "checked"?> \> |
|
| 587 | 587 | <span class="lever"></span> |
| 588 | 588 | On |
| 589 | 589 | </label> |
@@ -605,57 +605,57 @@ discard block |
||
| 605 | 605 | |
| 606 | 606 | <div class="row"> |
| 607 | 607 | <div class="col s12 m3 label"> |
| 608 | - <label for="webdav_url"><?php echo __("WebDAV Base Url",'xcloner-backup-and-restore')?></label> |
|
| 608 | + <label for="webdav_url"><?php echo __("WebDAV Base Url", 'xcloner-backup-and-restore')?></label> |
|
| 609 | 609 | </div> |
| 610 | 610 | <div class=" col s12 m6"> |
| 611 | - <input placeholder="<?php echo __("WebDAV Base Url",'xcloner-backup-and-restore')?>" id="webdav_url" type="text" name="xcloner_webdav_url" class="validate" value="<?php echo get_option("xcloner_webdav_url")?>" autocomplete="off" > |
|
| 611 | + <input placeholder="<?php echo __("WebDAV Base Url", 'xcloner-backup-and-restore')?>" id="webdav_url" type="text" name="xcloner_webdav_url" class="validate" value="<?php echo get_option("xcloner_webdav_url")?>" autocomplete="off" > |
|
| 612 | 612 | </div> |
| 613 | 613 | </div> |
| 614 | 614 | |
| 615 | 615 | <div class="row"> |
| 616 | 616 | <div class="col s12 m3 label"> |
| 617 | - <label for="webdav_username"><?php echo __("WebDAV Username",'xcloner-backup-and-restore')?></label> |
|
| 617 | + <label for="webdav_username"><?php echo __("WebDAV Username", 'xcloner-backup-and-restore')?></label> |
|
| 618 | 618 | </div> |
| 619 | 619 | <div class=" col s12 m6"> |
| 620 | - <input placeholder="<?php echo __("WebDAV Username",'xcloner-backup-and-restore')?>" id="webdav_username" type="text" name="xcloner_webdav_username" class="validate" value="<?php echo get_option("xcloner_webdav_username")?>" autocomplete="off" > |
|
| 620 | + <input placeholder="<?php echo __("WebDAV Username", 'xcloner-backup-and-restore')?>" id="webdav_username" type="text" name="xcloner_webdav_username" class="validate" value="<?php echo get_option("xcloner_webdav_username")?>" autocomplete="off" > |
|
| 621 | 621 | </div> |
| 622 | 622 | </div> |
| 623 | 623 | |
| 624 | 624 | <div class="row"> |
| 625 | 625 | <div class="col s12 m3 label"> |
| 626 | - <label for="webdav_password"><?php echo __("WebDAV Password",'xcloner-backup-and-restore')?></label> |
|
| 626 | + <label for="webdav_password"><?php echo __("WebDAV Password", 'xcloner-backup-and-restore')?></label> |
|
| 627 | 627 | </div> |
| 628 | 628 | <div class=" col s12 m6"> |
| 629 | - <input placeholder="<?php echo __("WebDAV Password",'xcloner-backup-and-restore')?>" id="webdav_password" type="password" name="xcloner_webdav_password" class="validate" value="<?php echo get_option("xcloner_webdav_password")?>" autocomplete="off" > |
|
| 629 | + <input placeholder="<?php echo __("WebDAV Password", 'xcloner-backup-and-restore')?>" id="webdav_password" type="password" name="xcloner_webdav_password" class="validate" value="<?php echo get_option("xcloner_webdav_password")?>" autocomplete="off" > |
|
| 630 | 630 | </div> |
| 631 | 631 | </div> |
| 632 | 632 | |
| 633 | 633 | <div class="row"> |
| 634 | 634 | <div class="col s12 m3 label"> |
| 635 | - <label for="webdav_target_folder"><?php echo __("WebDAV Target Folder",'xcloner-backup-and-restore')?></label> |
|
| 635 | + <label for="webdav_target_folder"><?php echo __("WebDAV Target Folder", 'xcloner-backup-and-restore')?></label> |
|
| 636 | 636 | </div> |
| 637 | 637 | <div class=" col s12 m6"> |
| 638 | - <input placeholder="<?php echo __("WebDAV Target Folder",'xcloner-backup-and-restore')?>" id="webdav_target_folder" type="text" name="xcloner_webdav_target_folder" class="validate" value="<?php echo get_option("xcloner_webdav_target_folder")?>" autocomplete="off" > |
|
| 638 | + <input placeholder="<?php echo __("WebDAV Target Folder", 'xcloner-backup-and-restore')?>" id="webdav_target_folder" type="text" name="xcloner_webdav_target_folder" class="validate" value="<?php echo get_option("xcloner_webdav_target_folder")?>" autocomplete="off" > |
|
| 639 | 639 | </div> |
| 640 | 640 | </div> |
| 641 | 641 | |
| 642 | 642 | <div class="row"> |
| 643 | 643 | <div class="col s12 m3 label"> |
| 644 | - <label for="webdav_cleanup_days"><?php echo __("WebDAV Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
| 644 | + <label for="webdav_cleanup_days"><?php echo __("WebDAV Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
| 645 | 645 | </div> |
| 646 | 646 | <div class=" col s12 m6"> |
| 647 | - <input placeholder="<?php echo __("how many days to keep the backups for",'xcloner-backup-and-restore')?>" id="webdav_cleanup_days" type="text" name="xcloner_webdav_cleanup_days" class="validate" value="<?php echo get_option("xcloner_webdav_cleanup_days")?>"> |
|
| 647 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore')?>" id="webdav_cleanup_days" type="text" name="xcloner_webdav_cleanup_days" class="validate" value="<?php echo get_option("xcloner_webdav_cleanup_days")?>"> |
|
| 648 | 648 | </div> |
| 649 | 649 | </div> |
| 650 | 650 | |
| 651 | 651 | <div class="row"> |
| 652 | 652 | <div class="col s6 m4"> |
| 653 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="webdav"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
| 653 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="webdav"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
| 654 | 654 | <i class="material-icons right">save</i> |
| 655 | 655 | </button> |
| 656 | 656 | </div> |
| 657 | 657 | <div class="col s6 m4"> |
| 658 | - <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="webdav" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify",'xcloner-backup-and-restore')?> |
|
| 658 | + <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="webdav" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore')?> |
|
| 659 | 659 | <i class="material-icons right">import_export</i> |
| 660 | 660 | </button> |
| 661 | 661 | </div> |
@@ -667,13 +667,13 @@ discard block |
||
| 667 | 667 | <!-- Google DRIVE STORAGE--> |
| 668 | 668 | <li id="gdrive"> |
| 669 | 669 | <div class="collapsible-header"> |
| 670 | - <i class="material-icons">computer</i><?php echo __("Google Drive Storage",'xcloner-backup-and-restore')?> |
|
| 671 | - <?php if($gdrive_construct):?> |
|
| 670 | + <i class="material-icons">computer</i><?php echo __("Google Drive Storage", 'xcloner-backup-and-restore')?> |
|
| 671 | + <?php if ($gdrive_construct):?> |
|
| 672 | 672 | <div class="right"> |
| 673 | 673 | <div class="switch"> |
| 674 | 674 | <label> |
| 675 | 675 | Off |
| 676 | - <input type="checkbox" name="xcloner_gdrive_enable" class="status" value="1" <?php if(get_option("xcloner_gdrive_enable")) echo "checked"?> \> |
|
| 676 | + <input type="checkbox" name="xcloner_gdrive_enable" class="status" value="1" <?php if (get_option("xcloner_gdrive_enable")) echo "checked"?> \> |
|
| 677 | 677 | <span class="lever"></span> |
| 678 | 678 | On |
| 679 | 679 | </label> |
@@ -683,7 +683,7 @@ discard block |
||
| 683 | 683 | </div> |
| 684 | 684 | <div class="collapsible-body"> |
| 685 | 685 | |
| 686 | - <?php if($gdrive_construct) : ?> |
|
| 686 | + <?php if ($gdrive_construct) : ?> |
|
| 687 | 687 | |
| 688 | 688 | <div class="row"> |
| 689 | 689 | <div class="col s12 m3 label"> |
@@ -691,28 +691,28 @@ discard block |
||
| 691 | 691 | </div> |
| 692 | 692 | <div class=" col s12 m9"> |
| 693 | 693 | <p> |
| 694 | - <?php echo sprintf(__('Visit %s to create a new application and get your Client ID and Client Secret.','xcloner-backup-and-restore'), '<a href="https://console.developers.google.com" target="_blank">https://console.developers.google.com</a>')?> |
|
| 694 | + <?php echo sprintf(__('Visit %s to create a new application and get your Client ID and Client Secret.', 'xcloner-backup-and-restore'), '<a href="https://console.developers.google.com" target="_blank">https://console.developers.google.com</a>')?> |
|
| 695 | 695 | <a href="https://youtu.be/YXUVPUVgG8k" target="_blank" class="btn-floating tooltipped btn-small" data-position="right" data-delay="50" data-html="true" |
| 696 | - data-tooltip="<?php echo sprintf(__('Click here to view a short video explaining how to create the Client ID and Client Secret as well as connecting XCloner with the Google Drive API %s','xcloner-backup-and-restore'),"<br />https://youtu.be/YXUVPUVgG8k")?>" data-tooltip-id="92c95730-94e9-7b59-bd52-14adc30d5e3e"><i class="material-icons">help_outline</i></a> |
|
| 696 | + data-tooltip="<?php echo sprintf(__('Click here to view a short video explaining how to create the Client ID and Client Secret as well as connecting XCloner with the Google Drive API %s', 'xcloner-backup-and-restore'), "<br />https://youtu.be/YXUVPUVgG8k")?>" data-tooltip-id="92c95730-94e9-7b59-bd52-14adc30d5e3e"><i class="material-icons">help_outline</i></a> |
|
| 697 | 697 | </p> |
| 698 | 698 | </div> |
| 699 | 699 | </div> |
| 700 | 700 | |
| 701 | 701 | <div class="row"> |
| 702 | 702 | <div class="col s12 m3 label"> |
| 703 | - <label for="gdrive_client_id"><?php echo __("Client ID",'xcloner-backup-and-restore')?></label> |
|
| 703 | + <label for="gdrive_client_id"><?php echo __("Client ID", 'xcloner-backup-and-restore')?></label> |
|
| 704 | 704 | </div> |
| 705 | 705 | <div class=" col s12 m6"> |
| 706 | - <input placeholder="<?php echo __("Google Client ID",'xcloner-backup-and-restore')?>" id="gdrive_client_id" type="text" name="xcloner_gdrive_client_id" class="validate" value="<?php echo get_option("xcloner_gdrive_client_id")?>"> |
|
| 706 | + <input placeholder="<?php echo __("Google Client ID", 'xcloner-backup-and-restore')?>" id="gdrive_client_id" type="text" name="xcloner_gdrive_client_id" class="validate" value="<?php echo get_option("xcloner_gdrive_client_id")?>"> |
|
| 707 | 707 | </div> |
| 708 | 708 | </div> |
| 709 | 709 | |
| 710 | 710 | <div class="row"> |
| 711 | 711 | <div class="col s12 m3 label"> |
| 712 | - <label for="gdrive_client_secret"><?php echo __("Client Secret",'xcloner-backup-and-restore')?></label> |
|
| 712 | + <label for="gdrive_client_secret"><?php echo __("Client Secret", 'xcloner-backup-and-restore')?></label> |
|
| 713 | 713 | </div> |
| 714 | 714 | <div class=" col s12 m6"> |
| 715 | - <input placeholder="<?php echo __("Google Client Secret",'xcloner-backup-and-restore')?>" id="gdrive_client_secret" type="text" name="xcloner_gdrive_client_secret" class="validate" value="<?php echo get_option("xcloner_gdrive_client_secret")?>"> |
|
| 715 | + <input placeholder="<?php echo __("Google Client Secret", 'xcloner-backup-and-restore')?>" id="gdrive_client_secret" type="text" name="xcloner_gdrive_client_secret" class="validate" value="<?php echo get_option("xcloner_gdrive_client_secret")?>"> |
|
| 716 | 716 | </div> |
| 717 | 717 | </div> |
| 718 | 718 | |
@@ -722,41 +722,41 @@ discard block |
||
| 722 | 722 | |
| 723 | 723 | </div> |
| 724 | 724 | <div class=" col s12 m6"> |
| 725 | - <a class="btn" target="_blank" id="gdrive_authorization_click" onclick="jQuery('#authentification_code').show()" href="<?php echo $gdrive_auth_url?>"><?php echo sprintf(__('Authorize Google Drive','xcloner-backup-and-restore'))?></a> |
|
| 726 | - <input type="text" name="authentification_code" id="authentification_code" placeholder="<?php echo __("Paste Authorization Code Here","xcloner-backup-and-restore")?>"> |
|
| 725 | + <a class="btn" target="_blank" id="gdrive_authorization_click" onclick="jQuery('#authentification_code').show()" href="<?php echo $gdrive_auth_url?>"><?php echo sprintf(__('Authorize Google Drive', 'xcloner-backup-and-restore'))?></a> |
|
| 726 | + <input type="text" name="authentification_code" id="authentification_code" placeholder="<?php echo __("Paste Authorization Code Here", "xcloner-backup-and-restore")?>"> |
|
| 727 | 727 | </div> |
| 728 | 728 | </div> |
| 729 | 729 | |
| 730 | 730 | <div class="row"> |
| 731 | 731 | <div class="col s12 m3 label"> |
| 732 | - <label for="gdrive_target_folder"><?php echo __("Folder ID or Root Path",'xcloner-backup-and-restore')?> |
|
| 732 | + <label for="gdrive_target_folder"><?php echo __("Folder ID or Root Path", 'xcloner-backup-and-restore')?> |
|
| 733 | 733 | <a class="btn-floating tooltipped btn-small" data-position="right" data-delay="50" data-html="true" \ |
| 734 | 734 | data-tooltip="<?php echo __('Folder ID can be found by right clicking on the folder name and selecting \'Get shareable link\' menu, format https://drive.google.com/open?id={FOLDER_ID}<br /> |
| 735 | 735 | If you supply a folder name, it has to exists in the drive root and start with / , example /backups.xcloner.com/','xcloner-backup-and-restore')?>" data-tooltip-id="92c95730-94e9-7b59-bd52-14adc30d5e3e"><i class="material-icons">help_outline</i></a> |
| 736 | 736 | </label> |
| 737 | 737 | </div> |
| 738 | 738 | <div class=" col s12 m6"> |
| 739 | - <input placeholder="<?php echo __("Target Folder ID or Root Path",'xcloner-backup-and-restore')?>" id="gdrive_target_folder" type="text" name="xcloner_gdrive_target_folder" class="validate" value="<?php echo get_option("xcloner_gdrive_target_folder")?>" autocomplete="off" > |
|
| 739 | + <input placeholder="<?php echo __("Target Folder ID or Root Path", 'xcloner-backup-and-restore')?>" id="gdrive_target_folder" type="text" name="xcloner_gdrive_target_folder" class="validate" value="<?php echo get_option("xcloner_gdrive_target_folder")?>" autocomplete="off" > |
|
| 740 | 740 | </div> |
| 741 | 741 | </div> |
| 742 | 742 | |
| 743 | 743 | <div class="row"> |
| 744 | 744 | <div class="col s12 m3 label"> |
| 745 | - <label for="gdrive_cleanup_days"><?php echo __("Google Drive Cleanup (days)",'xcloner-backup-and-restore')?></label> |
|
| 745 | + <label for="gdrive_cleanup_days"><?php echo __("Google Drive Cleanup (days)", 'xcloner-backup-and-restore')?></label> |
|
| 746 | 746 | </div> |
| 747 | 747 | <div class=" col s12 m6"> |
| 748 | - <input placeholder="<?php echo __("how many days to keep the backups for",'xcloner-backup-and-restore')?>" id="gdrive_cleanup_days" type="text" name="xcloner_gdrive_cleanup_days" class="validate" value="<?php echo get_option("xcloner_gdrive_cleanup_days")?>"> |
|
| 748 | + <input placeholder="<?php echo __("how many days to keep the backups for", 'xcloner-backup-and-restore')?>" id="gdrive_cleanup_days" type="text" name="xcloner_gdrive_cleanup_days" class="validate" value="<?php echo get_option("xcloner_gdrive_cleanup_days")?>"> |
|
| 749 | 749 | </div> |
| 750 | 750 | </div> |
| 751 | 751 | |
| 752 | 752 | <div class="row"> |
| 753 | 753 | <div class="col s6 m4"> |
| 754 | - <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="gdrive"><?php echo __("Save Settings",'xcloner-backup-and-restore')?> |
|
| 754 | + <button class="btn waves-effect waves-light" type="submit" name="action" id="action" value="gdrive"><?php echo __("Save Settings", 'xcloner-backup-and-restore')?> |
|
| 755 | 755 | <i class="material-icons right">save</i> |
| 756 | 756 | </button> |
| 757 | 757 | </div> |
| 758 | 758 | <div class="col s6 m4"> |
| 759 | - <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="gdrive" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify",'xcloner-backup-and-restore')?> |
|
| 759 | + <button class="btn waves-effect waves-light orange" type="submit" name="action" id="action" value="gdrive" onclick="jQuery('#connection_check').val('1')"><?php echo __("Verify", 'xcloner-backup-and-restore')?> |
|
| 760 | 760 | <i class="material-icons right">import_export</i> |
| 761 | 761 | </button> |
| 762 | 762 | </div> |
@@ -772,15 +772,15 @@ discard block |
||
| 772 | 772 | <h6><?php echo __("This storage option requires the XCloner-Google-Drive Wordpress Plugin to be installed and activated.")?></h6> |
| 773 | 773 | <h6><?php echo __("PHP 5.5 minimum version is required.")?></h6> |
| 774 | 774 | <br /> |
| 775 | - <a class="install-now btn" data-slug="xcloner-google-drive" href="<?php echo $url;?>" aria-label="Install XCloner Google Drive 1.0.0 now" data-name="XCloner Google Drive 1.0.0"> |
|
| 776 | - <?php echo sprintf(__('Install Now','xcloner-backup-and-restore'))?> |
|
| 775 | + <a class="install-now btn" data-slug="xcloner-google-drive" href="<?php echo $url; ?>" aria-label="Install XCloner Google Drive 1.0.0 now" data-name="XCloner Google Drive 1.0.0"> |
|
| 776 | + <?php echo sprintf(__('Install Now', 'xcloner-backup-and-restore'))?> |
|
| 777 | 777 | </a> |
| 778 | 778 | |
| 779 | 779 | <a href="<?php echo admin_url("plugin-install.php")?>?tab=plugin-information&plugin=xcloner-google-drive&TB_iframe=true&width=772&height=499" class="btn thickbox open-plugin-details-modal" aria-label="More information about Theme Check 20160523.1" data-title="Theme Check 20160523.1"> |
| 780 | 780 | <!-- |
| 781 | 781 | <a class="btn" href="https://github.com/ovidiul/XCloner-Google-Drive/archive/master.zip"> |
| 782 | 782 | --> |
| 783 | - <?php echo sprintf(__('More Details','xcloner-backup-and-restore'))?> |
|
| 783 | + <?php echo sprintf(__('More Details', 'xcloner-backup-and-restore'))?> |
|
| 784 | 784 | </a> |
| 785 | 785 | </div> |
| 786 | 786 | </div> |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$xcloner_file_system = $this->get_xcloner_container()->get_xcloner_filesystem(); |
|
| 4 | -$xcloner_sanitization = $this->get_xcloner_container()->get_xcloner_sanitization(); |
|
| 5 | -$xcloner_remote_storage = $this->get_xcloner_container()->get_xcloner_remote_storage(); |
|
| 6 | -$storage_selection = ""; |
|
| 3 | +$xcloner_file_system = $this->get_xcloner_container()->get_xcloner_filesystem(); |
|
| 4 | +$xcloner_sanitization = $this->get_xcloner_container()->get_xcloner_sanitization(); |
|
| 5 | +$xcloner_remote_storage = $this->get_xcloner_container()->get_xcloner_remote_storage(); |
|
| 6 | +$storage_selection = ""; |
|
| 7 | 7 | |
| 8 | -if(isset($_GET['storage_selection']) and $_GET['storage_selection']) |
|
| 8 | +if (isset($_GET['storage_selection']) and $_GET['storage_selection']) |
|
| 9 | 9 | { |
| 10 | 10 | $storage_selection = $xcloner_sanitization->sanitize_input_as_string($_GET['storage_selection']); |
| 11 | 11 | } |
@@ -21,18 +21,18 @@ discard block |
||
| 21 | 21 | <div class="col s12 m6 l9"> |
| 22 | 22 | <h1><?= esc_html(get_admin_page_title()); ?></h1> |
| 23 | 23 | </div> |
| 24 | - <?php if(sizeof($available_storages)):?> |
|
| 24 | + <?php if (sizeof($available_storages)):?> |
|
| 25 | 25 | <div class="col s12 m6 l3 remote-storage-selection"> |
| 26 | 26 | <select name="storage_selection" id="storage_selection" class="validate" required > |
| 27 | 27 | |
| 28 | - <?php if($storage_selection):?> |
|
| 28 | + <?php if ($storage_selection):?> |
|
| 29 | 29 | <option value="" selected><?php echo __('Change To Local Storage...', 'xcloner-backup-and-restore') ?></option> |
| 30 | 30 | <?php else: ?> |
| 31 | 31 | <option value="" selected><?php echo __('Change To Remote Storage...', 'xcloner-backup-and-restore') ?></option> |
| 32 | - <?php endif;?> |
|
| 32 | + <?php endif; ?> |
|
| 33 | 33 | |
| 34 | - <?php foreach($available_storages as $storage=>$text):?> |
|
| 35 | - <option value="<?php echo $storage?>"<?php if($storage == $storage_selection) echo "selected"?>><?php echo $text?></option> |
|
| 34 | + <?php foreach ($available_storages as $storage=>$text):?> |
|
| 35 | + <option value="<?php echo $storage?>"<?php if ($storage == $storage_selection) echo "selected"?>><?php echo $text?></option> |
|
| 36 | 36 | <?php endforeach?> |
| 37 | 37 | </select> |
| 38 | 38 | <?php endif?> |
@@ -47,10 +47,10 @@ discard block |
||
| 47 | 47 | <label for="select_all"> </label> |
| 48 | 48 | </p> |
| 49 | 49 | </th> |
| 50 | - <th data-field="id"><?php echo __("Backup Name",'xcloner-backup-and-restore')?></th> |
|
| 51 | - <th data-field="name"><?php echo __("Created Time",'xcloner-backup-and-restore')?></th> |
|
| 52 | - <th data-field="name"><?php echo __("Size",'xcloner-backup-and-restore')?></th> |
|
| 53 | - <th class="no-sort" data-field="price"><?php echo __("Action",'xcloner-backup-and-restore')?></th> |
|
| 50 | + <th data-field="id"><?php echo __("Backup Name", 'xcloner-backup-and-restore')?></th> |
|
| 51 | + <th data-field="name"><?php echo __("Created Time", 'xcloner-backup-and-restore')?></th> |
|
| 52 | + <th data-field="name"><?php echo __("Size", 'xcloner-backup-and-restore')?></th> |
|
| 53 | + <th class="no-sort" data-field="price"><?php echo __("Action", 'xcloner-backup-and-restore')?></th> |
|
| 54 | 54 | |
| 55 | 55 | </tr> |
| 56 | 56 | </thead> |
@@ -60,20 +60,20 @@ discard block |
||
| 60 | 60 | |
| 61 | 61 | <?php |
| 62 | 62 | $i = 0; |
| 63 | -foreach($backup_list as $file_info):?> |
|
| 63 | +foreach ($backup_list as $file_info):?> |
|
| 64 | 64 | <?php |
| 65 | - if($storage_selection == "gdrive") |
|
| 65 | + if ($storage_selection == "gdrive") |
|
| 66 | 66 | $file_info['path'] = $file_info['filename'].".".$file_info['extension']; |
| 67 | 67 | $file_exists_on_local_storage = true; |
| 68 | 68 | |
| 69 | - if($storage_selection) |
|
| 69 | + if ($storage_selection) |
|
| 70 | 70 | { |
| 71 | - if(!$xcloner_file_system->get_storage_filesystem()->has($file_info['path'])) |
|
| 71 | + if (!$xcloner_file_system->get_storage_filesystem()->has($file_info['path'])) |
|
| 72 | 72 | $file_exists_on_local_storage = false; |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | ?> |
| 76 | -<?php if(!isset($file_info['parent'])):?> |
|
| 76 | +<?php if (!isset($file_info['parent'])):?> |
|
| 77 | 77 | |
| 78 | 78 | <tr> |
| 79 | 79 | <td class="checkbox"> |
@@ -84,55 +84,55 @@ discard block |
||
| 84 | 84 | </td> |
| 85 | 85 | <td> |
| 86 | 86 | <span class=""><?php echo $file_info['path']?></span> |
| 87 | - <?php if(!$file_exists_on_local_storage): ?> |
|
| 88 | - <a href="#" title="<?php echo __("File does not exists on local storage","xcloner-backup-and-restore")?>"><i class="material-icons backup_warning">warning</i></a> |
|
| 87 | + <?php if (!$file_exists_on_local_storage): ?> |
|
| 88 | + <a href="#" title="<?php echo __("File does not exists on local storage", "xcloner-backup-and-restore")?>"><i class="material-icons backup_warning">warning</i></a> |
|
| 89 | 89 | <?php endif?> |
| 90 | 90 | <?php |
| 91 | - if(isset($file_info['childs']) and is_array($file_info['childs'])): |
|
| 91 | + if (isset($file_info['childs']) and is_array($file_info['childs'])): |
|
| 92 | 92 | ?> |
| 93 | 93 | <a href="#" title="expand" class="expand-multipart add"><i class="material-icons">add</i></a> |
| 94 | 94 | <a href="#" title="collapse" class="expand-multipart remove"><i class="material-icons">remove</i></a> |
| 95 | 95 | <ul class="multipart"> |
| 96 | - <?php foreach($file_info['childs'] as $child):?> |
|
| 96 | + <?php foreach ($file_info['childs'] as $child):?> |
|
| 97 | 97 | <li> |
| 98 | 98 | <?php echo $child[0]?> (<?php echo size_format($child[2])?>) |
| 99 | 99 | <?php |
| 100 | 100 | $child_exists_on_local_storage = true; |
| 101 | - if($storage_selection) |
|
| 101 | + if ($storage_selection) |
|
| 102 | 102 | { |
| 103 | - if(!$xcloner_file_system->get_storage_filesystem()->has($child[0])) |
|
| 103 | + if (!$xcloner_file_system->get_storage_filesystem()->has($child[0])) |
|
| 104 | 104 | $child_exists_on_local_storage = false; |
| 105 | 105 | } |
| 106 | 106 | ?> |
| 107 | - <?php if(!$child_exists_on_local_storage): ?> |
|
| 108 | - <a href="#" title="<?php echo __("File does not exists on local storage","xcloner-backup-and-restore")?>"><i class="material-icons backup_warning">warning</i></a> |
|
| 107 | + <?php if (!$child_exists_on_local_storage): ?> |
|
| 108 | + <a href="#" title="<?php echo __("File does not exists on local storage", "xcloner-backup-and-restore")?>"><i class="material-icons backup_warning">warning</i></a> |
|
| 109 | 109 | <?php endif?> |
| 110 | - <?php if(!$storage_selection) :?> |
|
| 111 | - <a href="#<?php echo $child[0];?>" class="download" title="Download Backup"><i class="material-icons">file_download</i></a> |
|
| 112 | - <a href="#<?php echo $child[0]?>" class="list-backup-content" title="<?php echo __('List Backup Content','xcloner-backup-and-restore')?>"><i class="material-icons">folder_open</i></a> |
|
| 113 | - <?php elseif($storage_selection != "gdrive" && !$xcloner_file_system->get_storage_filesystem()->has($child[0])): ?> |
|
| 114 | - <a href="#<?php echo $child[0]?>" class="copy-remote-to-local" title="<?php echo __('Push Backup To Local Storage','xcloner-backup-and-restore')?>"><i class="material-icons">file_upload</i></a> |
|
| 110 | + <?php if (!$storage_selection) :?> |
|
| 111 | + <a href="#<?php echo $child[0]; ?>" class="download" title="Download Backup"><i class="material-icons">file_download</i></a> |
|
| 112 | + <a href="#<?php echo $child[0]?>" class="list-backup-content" title="<?php echo __('List Backup Content', 'xcloner-backup-and-restore')?>"><i class="material-icons">folder_open</i></a> |
|
| 113 | + <?php elseif ($storage_selection != "gdrive" && !$xcloner_file_system->get_storage_filesystem()->has($child[0])): ?> |
|
| 114 | + <a href="#<?php echo $child[0]?>" class="copy-remote-to-local" title="<?php echo __('Push Backup To Local Storage', 'xcloner-backup-and-restore')?>"><i class="material-icons">file_upload</i></a> |
|
| 115 | 115 | <?php endif?> |
| 116 | 116 | </li> |
| 117 | - <?php endforeach;?> |
|
| 117 | + <?php endforeach; ?> |
|
| 118 | 118 | </ul> |
| 119 | - <?php endif;?> |
|
| 119 | + <?php endif; ?> |
|
| 120 | 120 | </td> |
| 121 | - <td><?php if(isset($file_info['timestamp'])) echo date("d M, Y H:i", $file_info['timestamp'])?></td> |
|
| 121 | + <td><?php if (isset($file_info['timestamp'])) echo date("d M, Y H:i", $file_info['timestamp'])?></td> |
|
| 122 | 122 | <td><?php echo size_format($file_info['size'])?></td> |
| 123 | 123 | <td> |
| 124 | - <?php if(!$storage_selection):?> |
|
| 125 | - <a href="#<?php echo $file_info['basename'];?>" class="download" title="<?php echo __('Download Backup','xcloner-backup-and-restore')?>"><i class="material-icons">file_download</i></a> |
|
| 124 | + <?php if (!$storage_selection):?> |
|
| 125 | + <a href="#<?php echo $file_info['basename']; ?>" class="download" title="<?php echo __('Download Backup', 'xcloner-backup-and-restore')?>"><i class="material-icons">file_download</i></a> |
|
| 126 | 126 | |
| 127 | - <?php if(sizeof($available_storages)):?> |
|
| 128 | - <a href="#<?php echo $file_info['basename']?>" class="cloud-upload" title="<?php echo __('Send Backup To Remote Storage','xcloner-backup-and-restore')?>"><i class="material-icons">cloud_upload</i></a> |
|
| 127 | + <?php if (sizeof($available_storages)):?> |
|
| 128 | + <a href="#<?php echo $file_info['basename']?>" class="cloud-upload" title="<?php echo __('Send Backup To Remote Storage', 'xcloner-backup-and-restore')?>"><i class="material-icons">cloud_upload</i></a> |
|
| 129 | 129 | <?php endif?> |
| 130 | - <a href="#<?php echo $file_info['basename']?>" class="list-backup-content" title="<?php echo __('List Backup Content','xcloner-backup-and-restore')?>"><i class="material-icons">folder_open</i></a> |
|
| 131 | - <?php endif;?> |
|
| 130 | + <a href="#<?php echo $file_info['basename']?>" class="list-backup-content" title="<?php echo __('List Backup Content', 'xcloner-backup-and-restore')?>"><i class="material-icons">folder_open</i></a> |
|
| 131 | + <?php endif; ?> |
|
| 132 | 132 | |
| 133 | - <a href="#<?php echo $file_info['basename']?>" class="delete" title="<?php echo __('Delete Backup','xcloner-backup-and-restore')?>"><i class="material-icons">delete</i></a> |
|
| 134 | - <?php if($storage_selection and !$file_exists_on_local_storage):?> |
|
| 135 | - <a href="#<?php echo $file_info['basename'];?>" class="copy-remote-to-local" title="<?php echo __('Push Backup To Local Storage','xcloner-backup-and-restore')?>"><i class="material-icons">file_upload</i></a> |
|
| 133 | + <a href="#<?php echo $file_info['basename']?>" class="delete" title="<?php echo __('Delete Backup', 'xcloner-backup-and-restore')?>"><i class="material-icons">delete</i></a> |
|
| 134 | + <?php if ($storage_selection and !$file_exists_on_local_storage):?> |
|
| 135 | + <a href="#<?php echo $file_info['basename']; ?>" class="copy-remote-to-local" title="<?php echo __('Push Backup To Local Storage', 'xcloner-backup-and-restore')?>"><i class="material-icons">file_upload</i></a> |
|
| 136 | 136 | <?php endif?> |
| 137 | 137 | |
| 138 | 138 | </td> |
@@ -145,12 +145,12 @@ discard block |
||
| 145 | 145 | </tbody> |
| 146 | 146 | </table> |
| 147 | 147 | |
| 148 | -<a class="waves-effect waves-light btn delete-all"><i class="material-icons left">delete</i><?php echo __("Delete",'xcloner-backup-and-restore')?></a> |
|
| 148 | +<a class="waves-effect waves-light btn delete-all"><i class="material-icons left">delete</i><?php echo __("Delete", 'xcloner-backup-and-restore')?></a> |
|
| 149 | 149 | |
| 150 | 150 | <!-- List Backup Content Modal--> |
| 151 | 151 | <div id="backup_cotent_modal" class="modal"> |
| 152 | 152 | <div class="modal-content"> |
| 153 | - <h4><?php echo sprintf(__("Listing Backup Content ",'xcloner-backup-and-restore'), "")?></h4> |
|
| 153 | + <h4><?php echo sprintf(__("Listing Backup Content ", 'xcloner-backup-and-restore'), "")?></h4> |
|
| 154 | 154 | <h5 class="backup-name"></h5> |
| 155 | 155 | |
| 156 | 156 | <div class="progress"> |
@@ -163,14 +163,14 @@ discard block |
||
| 163 | 163 | <!-- Local Transfer Modal--> |
| 164 | 164 | <div id="local_storage_upload_modal" class="modal"> |
| 165 | 165 | <div class="modal-content"> |
| 166 | - <h4><?php echo sprintf(__("Transfer Remote Backup To Local Storage",'xcloner-backup-and-restore'), "")?></h4> |
|
| 166 | + <h4><?php echo sprintf(__("Transfer Remote Backup To Local Storage", 'xcloner-backup-and-restore'), "")?></h4> |
|
| 167 | 167 | <h5 class="backup-name"></h5> |
| 168 | 168 | |
| 169 | 169 | <div class="row status"> |
| 170 | 170 | <div class="progress"> |
| 171 | 171 | <div class="indeterminate"></div> |
| 172 | 172 | </div> |
| 173 | - <?php echo __("Uploading backup to the local storage filesystem...",'xcloner-backup-and-restore')?> <span class="status-text"></span> |
|
| 173 | + <?php echo __("Uploading backup to the local storage filesystem...", 'xcloner-backup-and-restore')?> <span class="status-text"></span> |
|
| 174 | 174 | </div> |
| 175 | 175 | </div> |
| 176 | 176 | </div> |
@@ -180,17 +180,17 @@ discard block |
||
| 180 | 180 | <form method="POST" class="remote-storage-form"> |
| 181 | 181 | <input type="hidden" name="file" class="backup_name"> |
| 182 | 182 | <div class="modal-content"> |
| 183 | - <h4><?php echo __("Remote Storage Transfer",'xcloner-backup-and-restore')?></h4> |
|
| 183 | + <h4><?php echo __("Remote Storage Transfer", 'xcloner-backup-and-restore')?></h4> |
|
| 184 | 184 | <p> |
| 185 | - <?php if(sizeof($available_storages)):?> |
|
| 185 | + <?php if (sizeof($available_storages)):?> |
|
| 186 | 186 | <div class="row"> |
| 187 | 187 | <div class="col s12 label"> |
| 188 | - <label><?php echo sprintf(__('Send %s to remote storage','xcloner-backup-and-restore'), "<span class='backup_name'></span>") ?></label> |
|
| 188 | + <label><?php echo sprintf(__('Send %s to remote storage', 'xcloner-backup-and-restore'), "<span class='backup_name'></span>") ?></label> |
|
| 189 | 189 | </div> |
| 190 | 190 | <div class="input-field col s8 m10"> |
| 191 | 191 | <select name="transfer_storage" id="transfer_storage" class="validate" required > |
| 192 | 192 | <option value="" selected><?php echo __('please select...', 'xcloner-backup-and-restore') ?></option> |
| 193 | - <?php foreach($available_storages as $storage=>$text):?> |
|
| 193 | + <?php foreach ($available_storages as $storage=>$text):?> |
|
| 194 | 194 | <option value="<?php echo $storage?>"><?php echo $text?></option> |
| 195 | 195 | <?php endforeach?> |
| 196 | 196 | </select> |
@@ -201,7 +201,7 @@ discard block |
||
| 201 | 201 | </div> |
| 202 | 202 | </div> |
| 203 | 203 | <div class="row status"> |
| 204 | - <?php echo __("Uploading backup to the selected remote storage...",'xcloner-backup-and-restore')?> <span class="status-text"></span> |
|
| 204 | + <?php echo __("Uploading backup to the selected remote storage...", 'xcloner-backup-and-restore')?> <span class="status-text"></span> |
|
| 205 | 205 | <div class="progress"> |
| 206 | 206 | <div class="indeterminate"></div> |
| 207 | 207 | </div> |
@@ -27,12 +27,16 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | <?php if($storage_selection):?> |
| 29 | 29 | <option value="" selected><?php echo __('Change To Local Storage...', 'xcloner-backup-and-restore') ?></option> |
| 30 | - <?php else: ?> |
|
| 30 | + <?php else { |
|
| 31 | + : ?> |
|
| 31 | 32 | <option value="" selected><?php echo __('Change To Remote Storage...', 'xcloner-backup-and-restore') ?></option> |
| 32 | - <?php endif;?> |
|
| 33 | + <?php endif; |
|
| 34 | +} |
|
| 35 | +?> |
|
| 33 | 36 | |
| 34 | 37 | <?php foreach($available_storages as $storage=>$text):?> |
| 35 | - <option value="<?php echo $storage?>"<?php if($storage == $storage_selection) echo "selected"?>><?php echo $text?></option> |
|
| 38 | + <option value="<?php echo $storage?>"<?php if($storage == $storage_selection) { |
|
| 39 | + echo "selected"?>><?php echo $text?></option> |
|
| 36 | 40 | <?php endforeach?> |
| 37 | 41 | </select> |
| 38 | 42 | <?php endif?> |
@@ -60,16 +64,19 @@ discard block |
||
| 60 | 64 | |
| 61 | 65 | <?php |
| 62 | 66 | $i = 0; |
| 67 | +} |
|
| 63 | 68 | foreach($backup_list as $file_info):?> |
| 64 | 69 | <?php |
| 65 | - if($storage_selection == "gdrive") |
|
| 66 | - $file_info['path'] = $file_info['filename'].".".$file_info['extension']; |
|
| 70 | + if($storage_selection == "gdrive") { |
|
| 71 | + $file_info['path'] = $file_info['filename'].".".$file_info['extension']; |
|
| 72 | + } |
|
| 67 | 73 | $file_exists_on_local_storage = true; |
| 68 | 74 | |
| 69 | 75 | if($storage_selection) |
| 70 | 76 | { |
| 71 | - if(!$xcloner_file_system->get_storage_filesystem()->has($file_info['path'])) |
|
| 72 | - $file_exists_on_local_storage = false; |
|
| 77 | + if(!$xcloner_file_system->get_storage_filesystem()->has($file_info['path'])) { |
|
| 78 | + $file_exists_on_local_storage = false; |
|
| 79 | + } |
|
| 73 | 80 | } |
| 74 | 81 | |
| 75 | 82 | ?> |
@@ -100,8 +107,9 @@ discard block |
||
| 100 | 107 | $child_exists_on_local_storage = true; |
| 101 | 108 | if($storage_selection) |
| 102 | 109 | { |
| 103 | - if(!$xcloner_file_system->get_storage_filesystem()->has($child[0])) |
|
| 104 | - $child_exists_on_local_storage = false; |
|
| 110 | + if(!$xcloner_file_system->get_storage_filesystem()->has($child[0])) { |
|
| 111 | + $child_exists_on_local_storage = false; |
|
| 112 | + } |
|
| 105 | 113 | } |
| 106 | 114 | ?> |
| 107 | 115 | <?php if(!$child_exists_on_local_storage): ?> |
@@ -118,11 +126,14 @@ discard block |
||
| 118 | 126 | </ul> |
| 119 | 127 | <?php endif;?> |
| 120 | 128 | </td> |
| 121 | - <td><?php if(isset($file_info['timestamp'])) echo date("d M, Y H:i", $file_info['timestamp'])?></td> |
|
| 129 | + <td><?php if(isset($file_info['timestamp'])) { |
|
| 130 | + echo date("d M, Y H:i", $file_info['timestamp'])?></td> |
|
| 122 | 131 | <td><?php echo size_format($file_info['size'])?></td> |
| 123 | 132 | <td> |
| 124 | 133 | <?php if(!$storage_selection):?> |
| 125 | - <a href="#<?php echo $file_info['basename'];?>" class="download" title="<?php echo __('Download Backup','xcloner-backup-and-restore')?>"><i class="material-icons">file_download</i></a> |
|
| 134 | + <a href="#<?php echo $file_info['basename']; |
|
| 135 | +} |
|
| 136 | +?>" class="download" title="<?php echo __('Download Backup','xcloner-backup-and-restore')?>"><i class="material-icons">file_download</i></a> |
|
| 126 | 137 | |
| 127 | 138 | <?php if(sizeof($available_storages)):?> |
| 128 | 139 | <a href="#<?php echo $file_info['basename']?>" class="cloud-upload" title="<?php echo __('Send Backup To Remote Storage','xcloner-backup-and-restore')?>"><i class="material-icons">cloud_upload</i></a> |
@@ -4,12 +4,12 @@ discard block |
||
| 4 | 4 | use League\Flysystem\Util; |
| 5 | 5 | use League\Flysystem\Adapter\Local; |
| 6 | 6 | |
| 7 | -class Xcloner_File_System{ |
|
| 7 | +class Xcloner_File_System { |
|
| 8 | 8 | |
| 9 | - private $excluded_files = ""; |
|
| 10 | - private $excluded_files_by_default = array("administrator/backups", "wp-content/backups"); |
|
| 11 | - private $included_files_handler = "backup_files.csv"; |
|
| 12 | - private $temp_dir_handler = ".dir"; |
|
| 9 | + private $excluded_files = ""; |
|
| 10 | + private $excluded_files_by_default = array("administrator/backups", "wp-content/backups"); |
|
| 11 | + private $included_files_handler = "backup_files.csv"; |
|
| 12 | + private $temp_dir_handler = ".dir"; |
|
| 13 | 13 | public $filesystem; |
| 14 | 14 | public $tmp_filesystem; |
| 15 | 15 | public $storage_filesystem; |
@@ -37,40 +37,40 @@ discard block |
||
| 37 | 37 | { |
| 38 | 38 | $this->xcloner_container = $xcloner_container; |
| 39 | 39 | |
| 40 | - $this->logger = $xcloner_container->get_xcloner_logger()->withName("xcloner_file_system"); |
|
| 40 | + $this->logger = $xcloner_container->get_xcloner_logger()->withName("xcloner_file_system"); |
|
| 41 | 41 | $this->xcloner_settings = $xcloner_container->get_xcloner_settings(); |
| 42 | 42 | |
| 43 | - try{ |
|
| 43 | + try { |
|
| 44 | 44 | |
| 45 | - $this->start_adapter = new Local($this->xcloner_settings->get_xcloner_start_path(),LOCK_EX, 'SKIP_LINKS'); |
|
| 45 | + $this->start_adapter = new Local($this->xcloner_settings->get_xcloner_start_path(), LOCK_EX, 'SKIP_LINKS'); |
|
| 46 | 46 | $this->start_filesystem = new Filesystem($this->start_adapter, new Config([ |
| 47 | 47 | 'disable_asserts' => true, |
| 48 | 48 | ])); |
| 49 | 49 | |
| 50 | - $this->tmp_adapter = new Local($this->xcloner_settings->get_xcloner_tmp_path(),LOCK_EX, 'SKIP_LINKS'); |
|
| 50 | + $this->tmp_adapter = new Local($this->xcloner_settings->get_xcloner_tmp_path(), LOCK_EX, 'SKIP_LINKS'); |
|
| 51 | 51 | $this->tmp_filesystem = new Filesystem($this->tmp_adapter, new Config([ |
| 52 | 52 | 'disable_asserts' => true, |
| 53 | 53 | ])); |
| 54 | - $adapter = new Local($this->xcloner_settings->get_xcloner_tmp_path(),LOCK_EX|FILE_APPEND, 'SKIP_LINKS'); |
|
| 54 | + $adapter = new Local($this->xcloner_settings->get_xcloner_tmp_path(), LOCK_EX | FILE_APPEND, 'SKIP_LINKS'); |
|
| 55 | 55 | $this->tmp_filesystem_append = new Filesystem($adapter, new Config([ |
| 56 | 56 | 'disable_asserts' => true, |
| 57 | 57 | ])); |
| 58 | 58 | |
| 59 | - $adapter = new Local($this->xcloner_settings->get_xcloner_store_path(),LOCK_EX, 'SKIP_LINKS'); |
|
| 59 | + $adapter = new Local($this->xcloner_settings->get_xcloner_store_path(), LOCK_EX, 'SKIP_LINKS'); |
|
| 60 | 60 | $this->storage_filesystem = new Filesystem($adapter, new Config([ |
| 61 | 61 | 'disable_asserts' => true, |
| 62 | 62 | ])); |
| 63 | 63 | |
| 64 | - $this->storage_adapter = new Local($this->xcloner_settings->get_xcloner_store_path(),FILE_APPEND, 'SKIP_LINKS'); |
|
| 64 | + $this->storage_adapter = new Local($this->xcloner_settings->get_xcloner_store_path(), FILE_APPEND, 'SKIP_LINKS'); |
|
| 65 | 65 | $this->storage_filesystem_append = new Filesystem($this->storage_adapter, new Config([ |
| 66 | 66 | 'disable_asserts' => true, |
| 67 | 67 | ])); |
| 68 | - }catch(Exception $e){ |
|
| 68 | + }catch (Exception $e) { |
|
| 69 | 69 | $this->logger->error("Filesystem Initialization Error: ".$e->getMessage()); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | |
| 73 | - if($value = get_option('xcloner_directories_to_scan_per_request')) |
|
| 73 | + if ($value = get_option('xcloner_directories_to_scan_per_request')) |
|
| 74 | 74 | $this->folders_to_process_per_session = $value; |
| 75 | 75 | |
| 76 | 76 | } |
@@ -98,12 +98,12 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | public function get_storage_filesystem($remote_storage_selection = "") |
| 100 | 100 | { |
| 101 | - if($remote_storage_selection != "") |
|
| 101 | + if ($remote_storage_selection != "") |
|
| 102 | 102 | { |
| 103 | 103 | $remote_storage = $this->get_xcloner_container()->get_xcloner_remote_storage(); |
| 104 | 104 | $method = "get_".$remote_storage_selection."_filesystem"; |
| 105 | 105 | |
| 106 | - if(!method_exists($remote_storage, $method)) |
|
| 106 | + if (!method_exists($remote_storage, $method)) |
|
| 107 | 107 | return false; |
| 108 | 108 | |
| 109 | 109 | list($adapter, $filesystem) = $remote_storage->$method(); |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | public function get_start_path_file_info($file) |
| 143 | 143 | { |
| 144 | - $info= $this->getMetadataFull('start_adapter', $file); |
|
| 144 | + $info = $this->getMetadataFull('start_adapter', $file); |
|
| 145 | 145 | return $this->start_filesystem->normalizeFileInfo($info); |
| 146 | 146 | } |
| 147 | 147 | |
@@ -150,10 +150,10 @@ discard block |
||
| 150 | 150 | return $this->getMetadataFull('storage_adapter', $file); |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | - public function get_included_files_handler($metadata = 0) |
|
| 153 | + public function get_included_files_handler($metadata = 0) |
|
| 154 | 154 | { |
| 155 | 155 | $path = $this->included_files_handler; |
| 156 | - if(!$metadata) |
|
| 156 | + if (!$metadata) |
|
| 157 | 157 | return $path; |
| 158 | 158 | |
| 159 | 159 | $spl_info = $this->getMetadataFull('tmp_adapter', $path); |
@@ -170,16 +170,16 @@ discard block |
||
| 170 | 170 | { |
| 171 | 171 | $files = $this->get_backup_archives_list(); |
| 172 | 172 | |
| 173 | - if(is_array($files)) |
|
| 174 | - $this->sort_by($files, "timestamp","desc"); |
|
| 173 | + if (is_array($files)) |
|
| 174 | + $this->sort_by($files, "timestamp", "desc"); |
|
| 175 | 175 | |
| 176 | 176 | $new_list = array(); |
| 177 | 177 | |
| 178 | - foreach($files as $key=>$file) |
|
| 179 | - if(!isset($file['parent'])) |
|
| 178 | + foreach ($files as $key=>$file) |
|
| 179 | + if (!isset($file['parent'])) |
|
| 180 | 180 | $new_list[] = ($files[$key]); |
| 181 | 181 | |
| 182 | - if(isset($new_list[0])) |
|
| 182 | + if (isset($new_list[0])) |
|
| 183 | 183 | return $new_list[0]; |
| 184 | 184 | } |
| 185 | 185 | |
@@ -187,13 +187,13 @@ discard block |
||
| 187 | 187 | { |
| 188 | 188 | $files = $this->get_backup_archives_list(); |
| 189 | 189 | |
| 190 | - if(is_array($files)) |
|
| 191 | - $this->sort_by($files, "timestamp","desc"); |
|
| 190 | + if (is_array($files)) |
|
| 191 | + $this->sort_by($files, "timestamp", "desc"); |
|
| 192 | 192 | |
| 193 | 193 | $new_list = array(); |
| 194 | 194 | |
| 195 | - foreach($files as $key=>$file) |
|
| 196 | - if(!isset($file['parent'])) |
|
| 195 | + foreach ($files as $key=>$file) |
|
| 196 | + if (!isset($file['parent'])) |
|
| 197 | 197 | $new_list[] = ($files[$key]); |
| 198 | 198 | |
| 199 | 199 | return $new_list; |
@@ -204,8 +204,8 @@ discard block |
||
| 204 | 204 | $files = $this->get_backup_archives_list(); |
| 205 | 205 | $total = 0; |
| 206 | 206 | |
| 207 | - if(is_array($files)) |
|
| 208 | - foreach($files as $file) |
|
| 207 | + if (is_array($files)) |
|
| 208 | + foreach ($files as $file) |
|
| 209 | 209 | $total += $file['size']; |
| 210 | 210 | |
| 211 | 211 | return $total; |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | |
| 214 | 214 | public function is_part($backup_name) |
| 215 | 215 | { |
| 216 | - if(stristr($backup_name, "-part")) |
|
| 216 | + if (stristr($backup_name, "-part")) |
|
| 217 | 217 | return true; |
| 218 | 218 | |
| 219 | 219 | return false; |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | |
| 222 | 222 | public function is_multipart($backup_name) |
| 223 | 223 | { |
| 224 | - if(stristr($backup_name, "-multipart")) |
|
| 224 | + if (stristr($backup_name, "-multipart")) |
|
| 225 | 225 | return true; |
| 226 | 226 | |
| 227 | 227 | return false; |
@@ -230,10 +230,10 @@ discard block |
||
| 230 | 230 | public function get_backup_size($backup_name) |
| 231 | 231 | { |
| 232 | 232 | $backup_size = $this->get_storage_filesystem()->getSize($backup_name); |
| 233 | - if($this->is_multipart($backup_name)) |
|
| 233 | + if ($this->is_multipart($backup_name)) |
|
| 234 | 234 | { |
| 235 | 235 | $backup_parts = $this->get_multipart_files($backup_name); |
| 236 | - foreach($backup_parts as $part_file) |
|
| 236 | + foreach ($backup_parts as $part_file) |
|
| 237 | 237 | $backup_size += $this->get_storage_filesystem()->getSize($part_file); |
| 238 | 238 | } |
| 239 | 239 | |
@@ -244,12 +244,12 @@ discard block |
||
| 244 | 244 | { |
| 245 | 245 | $files = array(); |
| 246 | 246 | |
| 247 | - if($this->is_multipart($backup_name)) |
|
| 247 | + if ($this->is_multipart($backup_name)) |
|
| 248 | 248 | { |
| 249 | 249 | $lines = explode(PHP_EOL, $this->get_storage_filesystem($storage_selection)->read($backup_name)); |
| 250 | - foreach($lines as $line) |
|
| 250 | + foreach ($lines as $line) |
|
| 251 | 251 | { |
| 252 | - if($line) |
|
| 252 | + if ($line) |
|
| 253 | 253 | { |
| 254 | 254 | $data = str_getcsv($line); |
| 255 | 255 | $files[] = $data[0]; |
@@ -262,12 +262,12 @@ discard block |
||
| 262 | 262 | |
| 263 | 263 | public function delete_backup_by_name($backup_name, $storage_selection = "") |
| 264 | 264 | { |
| 265 | - if($this->is_multipart($backup_name)) |
|
| 265 | + if ($this->is_multipart($backup_name)) |
|
| 266 | 266 | { |
| 267 | 267 | $lines = explode(PHP_EOL, $this->get_storage_filesystem($storage_selection)->read($backup_name)); |
| 268 | - foreach($lines as $line) |
|
| 268 | + foreach ($lines as $line) |
|
| 269 | 269 | { |
| 270 | - if($line) |
|
| 270 | + if ($line) |
|
| 271 | 271 | { |
| 272 | 272 | $data = str_getcsv($line); |
| 273 | 273 | $this->get_storage_filesystem($storage_selection)->delete($data[0]); |
@@ -275,7 +275,7 @@ discard block |
||
| 275 | 275 | } |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | - if($this->get_storage_filesystem($storage_selection)->delete($backup_name)) |
|
| 278 | + if ($this->get_storage_filesystem($storage_selection)->delete($backup_name)) |
|
| 279 | 279 | $return = true; |
| 280 | 280 | else |
| 281 | 281 | $return = false; |
@@ -283,7 +283,7 @@ discard block |
||
| 283 | 283 | return $return; |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | - public function getMetadataFull($adapter = "storage_adapter" , $path) |
|
| 286 | + public function getMetadataFull($adapter = "storage_adapter", $path) |
|
| 287 | 287 | { |
| 288 | 288 | $location = $this->$adapter->applyPathPrefix($path); |
| 289 | 289 | $spl_info = new SplFileInfo($location); |
@@ -297,25 +297,25 @@ discard block |
||
| 297 | 297 | $list = array(); |
| 298 | 298 | |
| 299 | 299 | |
| 300 | - if(method_exists($this->get_storage_filesystem($storage_selection), "listContents")) |
|
| 300 | + if (method_exists($this->get_storage_filesystem($storage_selection), "listContents")) |
|
| 301 | 301 | $list = $this->get_storage_filesystem($storage_selection)->listContents(); |
| 302 | 302 | |
| 303 | 303 | |
| 304 | 304 | $backup_files = array(); |
| 305 | 305 | $parents = array(); |
| 306 | 306 | |
| 307 | - foreach($list as $file_info) |
|
| 307 | + foreach ($list as $file_info) |
|
| 308 | 308 | { |
| 309 | - if(isset($file_info['extension']) and $file_info['extension'] == "csv") |
|
| 309 | + if (isset($file_info['extension']) and $file_info['extension'] == "csv") |
|
| 310 | 310 | { |
| 311 | 311 | $data = array(); |
| 312 | 312 | |
| 313 | 313 | $lines = explode(PHP_EOL, $this->get_storage_filesystem($storage_selection)->read($file_info['path'])); |
| 314 | - foreach($lines as $line) |
|
| 315 | - if($line) |
|
| 314 | + foreach ($lines as $line) |
|
| 315 | + if ($line) |
|
| 316 | 316 | { |
| 317 | 317 | $data = str_getcsv($line); |
| 318 | - if(is_array($data)){ |
|
| 318 | + if (is_array($data)) { |
|
| 319 | 319 | $parents[$data[0]] = $file_info['basename']; |
| 320 | 320 | $file_info['childs'][] = $data; |
| 321 | 321 | $file_info['size'] += $data[2]; |
@@ -324,18 +324,18 @@ discard block |
||
| 324 | 324 | |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | - if($file_info['type'] == 'file' and isset($file_info['extension']) and in_array($file_info['extension'], $this->backup_archive_extensions)) |
|
| 327 | + if ($file_info['type'] == 'file' and isset($file_info['extension']) and in_array($file_info['extension'], $this->backup_archive_extensions)) |
|
| 328 | 328 | $backup_files[$file_info['path']] = $file_info; |
| 329 | 329 | } |
| 330 | 330 | |
| 331 | - foreach($backup_files as $key=>$file_info) |
|
| 331 | + foreach ($backup_files as $key=>$file_info) |
|
| 332 | 332 | { |
| 333 | - if(!isset($backup_files[$key]['timestamp'])) |
|
| 333 | + if (!isset($backup_files[$key]['timestamp'])) |
|
| 334 | 334 | { |
| 335 | 335 | //$backup_files[$key]['timestamp'] = $this->get_storage_filesystem($storage_selection)->getTimestamp($file_info['path']); |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | - if(isset($parents[$file_info['basename']])) |
|
| 338 | + if (isset($parents[$file_info['basename']])) |
|
| 339 | 339 | $backup_files[$key]['parent'] = $parents[$file_info['basename']]; |
| 340 | 340 | } |
| 341 | 341 | |
@@ -344,40 +344,40 @@ discard block |
||
| 344 | 344 | |
| 345 | 345 | public function start_file_recursion($init = 0) |
| 346 | 346 | { |
| 347 | - if($init) |
|
| 347 | + if ($init) |
|
| 348 | 348 | { |
| 349 | 349 | $this->logger->info(sprintf(__("Starting the filesystem scanner on root folder %s"), $this->xcloner_settings->get_xcloner_start_path())); |
| 350 | 350 | $this->do_system_init(); |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | - if($this->tmp_filesystem->has($this->get_temp_dir_handler())){ |
|
| 353 | + if ($this->tmp_filesystem->has($this->get_temp_dir_handler())) { |
|
| 354 | 354 | //.dir exists, we presume we have files to iterate |
| 355 | 355 | $content = $this->tmp_filesystem->read($this->get_temp_dir_handler()); |
| 356 | 356 | $files = array_filter(explode("\n", $content)); |
| 357 | 357 | $this->tmp_filesystem->delete($this->get_temp_dir_handler()); |
| 358 | 358 | |
| 359 | 359 | $counter = 0; |
| 360 | - foreach($files as $file) |
|
| 360 | + foreach ($files as $file) |
|
| 361 | 361 | { |
| 362 | - if($counter < $this->folders_to_process_per_session){ |
|
| 362 | + if ($counter < $this->folders_to_process_per_session) { |
|
| 363 | 363 | $this->build_files_list($file); |
| 364 | 364 | $counter++; |
| 365 | - }else{ |
|
| 365 | + } else { |
|
| 366 | 366 | $this->tmp_filesystem_append->write($this->get_temp_dir_handler(), $file."\n"); |
| 367 | 367 | } |
| 368 | 368 | } |
| 369 | - }else{ |
|
| 369 | + } else { |
|
| 370 | 370 | $this->build_files_list(); |
| 371 | 371 | } |
| 372 | 372 | |
| 373 | - if($this->scan_finished()) |
|
| 373 | + if ($this->scan_finished()) |
|
| 374 | 374 | { |
| 375 | 375 | $metadata_dumpfile = $this->get_tmp_filesystem()->getMetadata("index.html"); |
| 376 | 376 | $this->store_file($metadata_dumpfile, 'tmp_filesystem'); |
| 377 | 377 | $this->files_counter++; |
| 378 | 378 | |
| 379 | 379 | //adding included dump file to the included files list |
| 380 | - if($this->get_tmp_filesystem()->has($this->get_included_files_handler())) |
|
| 380 | + if ($this->get_tmp_filesystem()->has($this->get_included_files_handler())) |
|
| 381 | 381 | { |
| 382 | 382 | $metadata_dumpfile = $this->get_tmp_filesystem()->getMetadata($this->get_included_files_handler()); |
| 383 | 383 | $this->store_file($metadata_dumpfile, 'tmp_filesystem'); |
@@ -385,13 +385,13 @@ discard block |
||
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | //adding a default index.html to the temp xcloner folder |
| 388 | - if(!$this->get_tmp_filesystem()->has("index.html")) |
|
| 388 | + if (!$this->get_tmp_filesystem()->has("index.html")) |
|
| 389 | 389 | { |
| 390 | - $this->get_tmp_filesystem()->write("index.html",""); |
|
| 390 | + $this->get_tmp_filesystem()->write("index.html", ""); |
|
| 391 | 391 | } |
| 392 | 392 | |
| 393 | 393 | //adding the default log file |
| 394 | - if($this->get_tmp_filesystem()->has($this->xcloner_settings->get_logger_filename(1))) |
|
| 394 | + if ($this->get_tmp_filesystem()->has($this->xcloner_settings->get_logger_filename(1))) |
|
| 395 | 395 | { |
| 396 | 396 | $metadata_dumpfile = $this->get_tmp_filesystem()->getMetadata($this->xcloner_settings->get_logger_filename(1)); |
| 397 | 397 | $this->store_file($metadata_dumpfile, 'tmp_filesystem'); |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | { |
| 409 | 409 | $return = array(); |
| 410 | 410 | $return[] = $this->xcloner_settings->get_xcloner_tmp_path().DS.$this->get_included_files_handler(); |
| 411 | - if($this->xcloner_settings->get_xcloner_option('xcloner_enable_log')) |
|
| 411 | + if ($this->xcloner_settings->get_xcloner_option('xcloner_enable_log')) |
|
| 412 | 412 | $return[] = $this->xcloner_settings->get_xcloner_tmp_path().DS.$this->xcloner_settings->get_logger_filename(1); |
| 413 | 413 | |
| 414 | 414 | return $return; |
@@ -421,8 +421,8 @@ discard block |
||
| 421 | 421 | |
| 422 | 422 | $contents = $this->get_tmp_filesystem()->listContents(); |
| 423 | 423 | |
| 424 | - if(is_array($contents)) |
|
| 425 | - foreach($contents as $file_info) |
|
| 424 | + if (is_array($contents)) |
|
| 425 | + foreach ($contents as $file_info) |
|
| 426 | 426 | $this->get_tmp_filesystem()->delete($file_info['path']); |
| 427 | 427 | |
| 428 | 428 | @rmdir($this->xcloner_settings->get_xcloner_tmp_path()); |
@@ -434,16 +434,16 @@ discard block |
||
| 434 | 434 | { |
| 435 | 435 | $this->files_counter = 0; |
| 436 | 436 | |
| 437 | - if(!$this->storage_filesystem->has("index.html")) |
|
| 438 | - $this->storage_filesystem->write("index.html",""); |
|
| 437 | + if (!$this->storage_filesystem->has("index.html")) |
|
| 438 | + $this->storage_filesystem->write("index.html", ""); |
|
| 439 | 439 | |
| 440 | - if(!$this->tmp_filesystem->has("index.html")) |
|
| 441 | - $this->tmp_filesystem->write("index.html",""); |
|
| 440 | + if (!$this->tmp_filesystem->has("index.html")) |
|
| 441 | + $this->tmp_filesystem->write("index.html", ""); |
|
| 442 | 442 | |
| 443 | - if($this->tmp_filesystem->has($this->get_included_files_handler())) |
|
| 443 | + if ($this->tmp_filesystem->has($this->get_included_files_handler())) |
|
| 444 | 444 | $this->tmp_filesystem->delete($this->get_included_files_handler()); |
| 445 | 445 | |
| 446 | - if($this->tmp_filesystem->has($this->get_temp_dir_handler())) |
|
| 446 | + if ($this->tmp_filesystem->has($this->get_temp_dir_handler())) |
|
| 447 | 447 | $this->tmp_filesystem->delete($this->get_temp_dir_handler()); |
| 448 | 448 | } |
| 449 | 449 | |
@@ -464,7 +464,7 @@ discard block |
||
| 464 | 464 | |
| 465 | 465 | public function set_excluded_files($excluded_files = array()) |
| 466 | 466 | { |
| 467 | - if(!is_array($excluded_files)) |
|
| 467 | + if (!is_array($excluded_files)) |
|
| 468 | 468 | $excluded_files = array(); |
| 469 | 469 | |
| 470 | 470 | $this->excluded_files = array_merge($excluded_files, $this->excluded_files_by_default); |
@@ -487,33 +487,33 @@ discard block |
||
| 487 | 487 | $this->logger->debug(sprintf(("Building the files system list"))); |
| 488 | 488 | |
| 489 | 489 | //if we start with the root folder(empty value), we initializa the file system |
| 490 | - if(!$folder){ |
|
| 490 | + if (!$folder) { |
|
| 491 | 491 | |
| 492 | 492 | } |
| 493 | 493 | |
| 494 | - try{ |
|
| 494 | + try { |
|
| 495 | 495 | |
| 496 | 496 | $files = $this->start_filesystem->listContents($folder); |
| 497 | - foreach($files as $file) |
|
| 497 | + foreach ($files as $file) |
|
| 498 | 498 | { |
| 499 | - if(!is_readable($this->xcloner_settings->get_xcloner_start_path().DS.$file['path'])) |
|
| 499 | + if (!is_readable($this->xcloner_settings->get_xcloner_start_path().DS.$file['path'])) |
|
| 500 | 500 | { |
| 501 | - $this->logger->info(sprintf(__("Excluding %s from the filesystem list, file not readable"), $file['path']), array("FILESYSTEM SCAN","NOT READABLE")); |
|
| 501 | + $this->logger->info(sprintf(__("Excluding %s from the filesystem list, file not readable"), $file['path']), array("FILESYSTEM SCAN", "NOT READABLE")); |
|
| 502 | 502 | } |
| 503 | - elseif(!$matching_pattern = $this->is_excluded($file) ){ |
|
| 504 | - $this->logger->info(sprintf(__("Adding %s to the filesystem list"), $file['path']), array("FILESYSTEM SCAN","INCLUDE")); |
|
| 503 | + elseif (!$matching_pattern = $this->is_excluded($file)) { |
|
| 504 | + $this->logger->info(sprintf(__("Adding %s to the filesystem list"), $file['path']), array("FILESYSTEM SCAN", "INCLUDE")); |
|
| 505 | 505 | $file['visibility'] = $this->start_filesystem->getVisibility($file['path']); |
| 506 | 506 | $this->store_file($file); |
| 507 | 507 | $this->files_counter++; |
| 508 | - if(isset($file['size'])) |
|
| 508 | + if (isset($file['size'])) |
|
| 509 | 509 | $this->files_size += $file['size']; |
| 510 | 510 | |
| 511 | - }else{ |
|
| 512 | - $this->logger->info(sprintf(__("Excluding %s from the filesystem list, matching pattern %s"), $file['path'], $matching_pattern), array("FILESYSTEM SCAN","EXCLUDE")); |
|
| 511 | + } else { |
|
| 512 | + $this->logger->info(sprintf(__("Excluding %s from the filesystem list, matching pattern %s"), $file['path'], $matching_pattern), array("FILESYSTEM SCAN", "EXCLUDE")); |
|
| 513 | 513 | } |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | - }catch(Exception $e){ |
|
| 516 | + }catch (Exception $e) { |
|
| 517 | 517 | |
| 518 | 518 | $this->logger->error($e->getMessage()); |
| 519 | 519 | |
@@ -527,9 +527,9 @@ discard block |
||
| 527 | 527 | |
| 528 | 528 | $start_time = microtime(); |
| 529 | 529 | |
| 530 | - $data = str_repeat(rand(0,9), 1024*1024); //write 1MB data |
|
| 530 | + $data = str_repeat(rand(0, 9), 1024 * 1024); //write 1MB data |
|
| 531 | 531 | |
| 532 | - try{ |
|
| 532 | + try { |
|
| 533 | 533 | $this->tmp_filesystem->write($tmp_file, $data); |
| 534 | 534 | |
| 535 | 535 | $end_time = microtime() - $start_time; |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | |
| 541 | 541 | $this->tmp_filesystem->delete($tmp_file); |
| 542 | 542 | |
| 543 | - }catch(Exception $e){ |
|
| 543 | + }catch (Exception $e) { |
|
| 544 | 544 | |
| 545 | 545 | $this->logger->error($e->getMessage()); |
| 546 | 546 | |
@@ -561,10 +561,10 @@ discard block |
||
| 561 | 561 | |
| 562 | 562 | $files = $this->storage_filesystem->listContents(); |
| 563 | 563 | |
| 564 | - if(is_array($files)) |
|
| 565 | - foreach($files as $file) |
|
| 564 | + if (is_array($files)) |
|
| 565 | + foreach ($files as $file) |
|
| 566 | 566 | { |
| 567 | - if(isset($file['extension']) and in_array($file['extension'], $this->backup_archive_extensions)) |
|
| 567 | + if (isset($file['extension']) and in_array($file['extension'], $this->backup_archive_extensions)) |
|
| 568 | 568 | { |
| 569 | 569 | $_storage_size += $file['size']; //bytes |
| 570 | 570 | $_backup_files_list[] = $file; |
@@ -572,15 +572,15 @@ discard block |
||
| 572 | 572 | } |
| 573 | 573 | |
| 574 | 574 | |
| 575 | - $this->sort_by($_backup_files_list, "timestamp","asc"); |
|
| 575 | + $this->sort_by($_backup_files_list, "timestamp", "asc"); |
|
| 576 | 576 | |
| 577 | 577 | $_backups_counter = sizeof($_backup_files_list); |
| 578 | 578 | |
| 579 | - foreach($_backup_files_list as $file) |
|
| 579 | + foreach ($_backup_files_list as $file) |
|
| 580 | 580 | { |
| 581 | 581 | //processing rule folder capacity |
| 582 | - if($this->xcloner_settings->get_xcloner_option('xcloner_cleanup_capacity_limit') && |
|
| 583 | - $_storage_size >= ($set_storage_limit = 1024*1024*$this->xcloner_settings->get_xcloner_option('xcloner_cleanup_capacity_limit'))) //bytes |
|
| 582 | + if ($this->xcloner_settings->get_xcloner_option('xcloner_cleanup_capacity_limit') && |
|
| 583 | + $_storage_size >= ($set_storage_limit = 1024 * 1024 * $this->xcloner_settings->get_xcloner_option('xcloner_cleanup_capacity_limit'))) //bytes |
|
| 584 | 584 | { |
| 585 | 585 | $this->storage_filesystem->delete($file['path']); |
| 586 | 586 | $_storage_size -= $file['size']; |
@@ -588,14 +588,14 @@ discard block |
||
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | //processing rule days limit |
| 591 | - if($this->xcloner_settings->get_xcloner_option('xcloner_cleanup_retention_limit_days') && $current_timestamp >= $file['timestamp']) |
|
| 591 | + if ($this->xcloner_settings->get_xcloner_option('xcloner_cleanup_retention_limit_days') && $current_timestamp >= $file['timestamp']) |
|
| 592 | 592 | { |
| 593 | 593 | $this->storage_filesystem->delete($file['path']); |
| 594 | 594 | $this->logger->info("Deleting backup ".$file['path']." matching rule", array("RETENTION LIMIT TIMESTAMP", $file['timestamp']." =< ".$this->xcloner_settings->get_xcloner_option('xcloner_cleanup_retention_limit_days'))); |
| 595 | 595 | } |
| 596 | 596 | |
| 597 | 597 | //processing backup countert limit |
| 598 | - if($this->xcloner_settings->get_xcloner_option('xcloner_cleanup_retention_limit_archives') && $_backups_counter >= $this->xcloner_settings->get_xcloner_option('xcloner_cleanup_retention_limit_archives')) |
|
| 598 | + if ($this->xcloner_settings->get_xcloner_option('xcloner_cleanup_retention_limit_archives') && $_backups_counter >= $this->xcloner_settings->get_xcloner_option('xcloner_cleanup_retention_limit_archives')) |
|
| 599 | 599 | { |
| 600 | 600 | $this->storage_filesystem->delete($file['path']); |
| 601 | 601 | $_backups_counter--; |
@@ -621,33 +621,33 @@ discard block |
||
| 621 | 621 | |
| 622 | 622 | } |
| 623 | 623 | |
| 624 | - public function process_backup_name($name = "", $max_length=100) |
|
| 624 | + public function process_backup_name($name = "", $max_length = 100) |
|
| 625 | 625 | { |
| 626 | - if(!$name) |
|
| 626 | + if (!$name) |
|
| 627 | 627 | $name = $this->xcloner_settings->get_default_backup_name(); |
| 628 | 628 | |
| 629 | - foreach($this->backup_name_tags as $tag) |
|
| 629 | + foreach ($this->backup_name_tags as $tag) |
|
| 630 | 630 | { |
| 631 | - if($tag == '[time]') |
|
| 632 | - $name = str_replace($tag, date("Y-m-d_H-i"),$name); |
|
| 633 | - elseif($tag == '[hostname]') |
|
| 634 | - $name = str_replace($tag, gethostname() ,$name); |
|
| 635 | - elseif($tag == '[domain]') |
|
| 631 | + if ($tag == '[time]') |
|
| 632 | + $name = str_replace($tag, date("Y-m-d_H-i"), $name); |
|
| 633 | + elseif ($tag == '[hostname]') |
|
| 634 | + $name = str_replace($tag, gethostname(), $name); |
|
| 635 | + elseif ($tag == '[domain]') |
|
| 636 | 636 | { |
| 637 | 637 | $domain = parse_url(admin_url(), PHP_URL_HOST); |
| 638 | - $name = str_replace($tag, $domain ,$name); |
|
| 638 | + $name = str_replace($tag, $domain, $name); |
|
| 639 | 639 | } |
| 640 | 640 | } |
| 641 | 641 | |
| 642 | - if($max_length) |
|
| 642 | + if ($max_length) |
|
| 643 | 643 | $name = substr($name, 0, $max_length); |
| 644 | 644 | |
| 645 | 645 | return $name; |
| 646 | 646 | } |
| 647 | 647 | |
| 648 | - public function sort_by( &$array, $field, $direction = 'asc') |
|
| 648 | + public function sort_by(&$array, $field, $direction = 'asc') |
|
| 649 | 649 | { |
| 650 | - if(strtolower($direction) == "desc" || $direction == SORT_DESC) |
|
| 650 | + if (strtolower($direction) == "desc" || $direction == SORT_DESC) |
|
| 651 | 651 | $direction = SORT_DESC; |
| 652 | 652 | else |
| 653 | 653 | $direction = SORT_ASC; |
@@ -667,7 +667,7 @@ discard block |
||
| 667 | 667 | $tmp = array(); |
| 668 | 668 | foreach ($data as $key => $row) |
| 669 | 669 | { |
| 670 | - if(is_array($row)) |
|
| 670 | + if (is_array($row)) |
|
| 671 | 671 | $tmp[$key] = $row[$field]; |
| 672 | 672 | else |
| 673 | 673 | $tmp[$key] = $row->$field; |
@@ -686,29 +686,29 @@ discard block |
||
| 686 | 686 | { |
| 687 | 687 | $this->logger->debug(sprintf(("Checking if %s is excluded"), $file['path'])); |
| 688 | 688 | |
| 689 | - if($xcloner_exclude_files_larger_than_mb = $this->xcloner_settings->get_xcloner_option('xcloner_exclude_files_larger_than_mb')) |
|
| 689 | + if ($xcloner_exclude_files_larger_than_mb = $this->xcloner_settings->get_xcloner_option('xcloner_exclude_files_larger_than_mb')) |
|
| 690 | 690 | { |
| 691 | - if(isset($file['size']) && $file['size'] > $this->calc_to_bytes($xcloner_exclude_files_larger_than_mb)) |
|
| 691 | + if (isset($file['size']) && $file['size'] > $this->calc_to_bytes($xcloner_exclude_files_larger_than_mb)) |
|
| 692 | 692 | return "> ".$xcloner_exclude_files_larger_than_mb."MB"; |
| 693 | 693 | } |
| 694 | 694 | |
| 695 | - if(!sizeof($this->excluded_files)) |
|
| 695 | + if (!sizeof($this->excluded_files)) |
|
| 696 | 696 | $this->set_excluded_files(); |
| 697 | 697 | |
| 698 | - if(is_array($this->excluded_files)) |
|
| 699 | - foreach($this->excluded_files as $excluded_file_pattern) |
|
| 698 | + if (is_array($this->excluded_files)) |
|
| 699 | + foreach ($this->excluded_files as $excluded_file_pattern) |
|
| 700 | 700 | { |
| 701 | - if($excluded_file_pattern == "/") |
|
| 701 | + if ($excluded_file_pattern == "/") |
|
| 702 | 702 | $needle = "$"; |
| 703 | 703 | else |
| 704 | 704 | $needle = "$".$excluded_file_pattern; |
| 705 | 705 | |
| 706 | - if(strstr("$".$file['path'], $needle)){ |
|
| 706 | + if (strstr("$".$file['path'], $needle)) { |
|
| 707 | 707 | return $excluded_file_pattern; |
| 708 | 708 | } |
| 709 | 709 | } |
| 710 | 710 | |
| 711 | - if( $regex = $this->is_excluded_regex($file)) |
|
| 711 | + if ($regex = $this->is_excluded_regex($file)) |
|
| 712 | 712 | return $regex; |
| 713 | 713 | |
| 714 | 714 | return false; |
@@ -754,25 +754,25 @@ discard block |
||
| 754 | 754 | |
| 755 | 755 | //print_r($regex_patterns);exit; |
| 756 | 756 | |
| 757 | - if(is_array($regex_patterns)) |
|
| 757 | + if (is_array($regex_patterns)) |
|
| 758 | 758 | { |
| 759 | 759 | //$this->excluded_files = array(); |
| 760 | 760 | //$this->excluded_files[] ="(.*)\.(git)(.*)$"; |
| 761 | 761 | //$this->excluded_files[] ="wp-content\/backups(.*)$"; |
| 762 | 762 | |
| 763 | - foreach($regex_patterns as $excluded_file_pattern) |
|
| 763 | + foreach ($regex_patterns as $excluded_file_pattern) |
|
| 764 | 764 | { |
| 765 | 765 | |
| 766 | - if( substr($excluded_file_pattern, strlen($excluded_file_pattern)-1, strlen($excluded_file_pattern)) == "\r") |
|
| 767 | - $excluded_file_pattern = substr($excluded_file_pattern, 0, strlen($excluded_file_pattern)-1); |
|
| 766 | + if (substr($excluded_file_pattern, strlen($excluded_file_pattern) - 1, strlen($excluded_file_pattern)) == "\r") |
|
| 767 | + $excluded_file_pattern = substr($excluded_file_pattern, 0, strlen($excluded_file_pattern) - 1); |
|
| 768 | 768 | |
| 769 | - if($file['path'] == "/") |
|
| 769 | + if ($file['path'] == "/") |
|
| 770 | 770 | $needle = "/"; |
| 771 | 771 | else |
| 772 | 772 | $needle = "/".$file['path']; |
| 773 | 773 | //echo $needle."---".$excluded_file_pattern."---\n"; |
| 774 | 774 | |
| 775 | - if(@preg_match("/(^|^\/)".$excluded_file_pattern."/i", $needle)){ |
|
| 775 | + if (@preg_match("/(^|^\/)".$excluded_file_pattern."/i", $needle)) { |
|
| 776 | 776 | return $excluded_file_pattern; |
| 777 | 777 | } |
| 778 | 778 | } |
@@ -785,19 +785,19 @@ discard block |
||
| 785 | 785 | { |
| 786 | 786 | $this->logger->debug(sprintf("Storing %s in the backup list", $file['path'])); |
| 787 | 787 | |
| 788 | - if(!isset($file['size'])) |
|
| 788 | + if (!isset($file['size'])) |
|
| 789 | 789 | $file['size'] = 0; |
| 790 | - if(!isset($file['visibility'])) |
|
| 790 | + if (!isset($file['visibility'])) |
|
| 791 | 791 | $file['visibility'] = "private"; |
| 792 | 792 | |
| 793 | - $csv_filename = str_replace('"','""', $file['path']); |
|
| 793 | + $csv_filename = str_replace('"', '""', $file['path']); |
|
| 794 | 794 | |
| 795 | 795 | $line = '"'.($csv_filename).'","'.$file['timestamp'].'","'.$file['size'].'","'.$file['visibility'].'","'.$storage.'"'.PHP_EOL; |
| 796 | 796 | |
| 797 | 797 | $this->last_logged_file = $file['path']; |
| 798 | 798 | |
| 799 | - try{ |
|
| 800 | - if(!$this->tmp_filesystem_append->has($this->get_included_files_handler())) |
|
| 799 | + try { |
|
| 800 | + if (!$this->tmp_filesystem_append->has($this->get_included_files_handler())) |
|
| 801 | 801 | { |
| 802 | 802 | //adding fix for UTF-8 CSV preview |
| 803 | 803 | $start_line = "\xEF\xBB\xBF".'"Filename","Timestamp","Size","Visibility","Storage"'.PHP_EOL; |
@@ -806,15 +806,15 @@ discard block |
||
| 806 | 806 | |
| 807 | 807 | $this->tmp_filesystem_append->write($this->get_included_files_handler(), $line); |
| 808 | 808 | |
| 809 | - }catch(Exception $e){ |
|
| 809 | + }catch (Exception $e) { |
|
| 810 | 810 | |
| 811 | 811 | $this->logger->error($e->getMessage()); |
| 812 | 812 | } |
| 813 | 813 | |
| 814 | - if($file['type'] == "dir"){ |
|
| 815 | - try{ |
|
| 814 | + if ($file['type'] == "dir") { |
|
| 815 | + try { |
|
| 816 | 816 | $this->tmp_filesystem_append->write($this->get_temp_dir_handler(), $file['path']."\n"); |
| 817 | - }catch(Exception $e){ |
|
| 817 | + }catch (Exception $e) { |
|
| 818 | 818 | $this->logger->error($e->getMessage()); |
| 819 | 819 | } |
| 820 | 820 | } |
@@ -827,13 +827,13 @@ discard block |
||
| 827 | 827 | |
| 828 | 828 | public function get_filesystem($system = "") |
| 829 | 829 | { |
| 830 | - if($system == "storage_filesystem_append") |
|
| 830 | + if ($system == "storage_filesystem_append") |
|
| 831 | 831 | return $this->storage_filesystem_append; |
| 832 | - elseif($system == "tmp_filesystem_append") |
|
| 832 | + elseif ($system == "tmp_filesystem_append") |
|
| 833 | 833 | return $this->tmp_filesystem_append; |
| 834 | - elseif($system == "tmp_filesystem") |
|
| 834 | + elseif ($system == "tmp_filesystem") |
|
| 835 | 835 | return $this->tmp_filesystem; |
| 836 | - elseif($system == "storage_filesystem") |
|
| 836 | + elseif ($system == "storage_filesystem") |
|
| 837 | 837 | return $this->storage_filesystem; |
| 838 | 838 | else |
| 839 | 839 | return $this->start_filesystem; |
@@ -841,9 +841,9 @@ discard block |
||
| 841 | 841 | |
| 842 | 842 | public function get_adapter($system) |
| 843 | 843 | { |
| 844 | - if($system == "tmp_filesystem") |
|
| 844 | + if ($system == "tmp_filesystem") |
|
| 845 | 845 | return $this->tmp_adapter; |
| 846 | - elseif($system == "storage_filesystem") |
|
| 846 | + elseif ($system == "storage_filesystem") |
|
| 847 | 847 | return $this->storage_adapter; |
| 848 | 848 | else |
| 849 | 849 | return $this->start_adapter; |
@@ -851,10 +851,10 @@ discard block |
||
| 851 | 851 | |
| 852 | 852 | private function scan_finished() |
| 853 | 853 | { |
| 854 | - if($this->tmp_filesystem_append->has($this->get_temp_dir_handler()) && $this->tmp_filesystem_append->getSize($this->get_temp_dir_handler())) |
|
| 854 | + if ($this->tmp_filesystem_append->has($this->get_temp_dir_handler()) && $this->tmp_filesystem_append->getSize($this->get_temp_dir_handler())) |
|
| 855 | 855 | return false; |
| 856 | 856 | |
| 857 | - if($this->tmp_filesystem->has($this->get_temp_dir_handler())) |
|
| 857 | + if ($this->tmp_filesystem->has($this->get_temp_dir_handler())) |
|
| 858 | 858 | $this->tmp_filesystem->delete($this->get_temp_dir_handler()); |
| 859 | 859 | |
| 860 | 860 | $this->logger->debug(sprintf(("File scan finished"))); |
@@ -864,7 +864,7 @@ discard block |
||
| 864 | 864 | |
| 865 | 865 | private function calc_to_bytes($mb_size) |
| 866 | 866 | { |
| 867 | - return $mb_size*(1024*1024); |
|
| 867 | + return $mb_size * (1024 * 1024); |
|
| 868 | 868 | } |
| 869 | 869 | |
| 870 | 870 | } |
@@ -65,13 +65,14 @@ discard block |
||
| 65 | 65 | $this->storage_filesystem_append = new Filesystem($this->storage_adapter, new Config([ |
| 66 | 66 | 'disable_asserts' => true, |
| 67 | 67 | ])); |
| 68 | - }catch(Exception $e){ |
|
| 68 | + } catch(Exception $e){ |
|
| 69 | 69 | $this->logger->error("Filesystem Initialization Error: ".$e->getMessage()); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | |
| 73 | - if($value = get_option('xcloner_directories_to_scan_per_request')) |
|
| 74 | - $this->folders_to_process_per_session = $value; |
|
| 73 | + if($value = get_option('xcloner_directories_to_scan_per_request')) { |
|
| 74 | + $this->folders_to_process_per_session = $value; |
|
| 75 | + } |
|
| 75 | 76 | |
| 76 | 77 | } |
| 77 | 78 | |
@@ -103,8 +104,9 @@ discard block |
||
| 103 | 104 | $remote_storage = $this->get_xcloner_container()->get_xcloner_remote_storage(); |
| 104 | 105 | $method = "get_".$remote_storage_selection."_filesystem"; |
| 105 | 106 | |
| 106 | - if(!method_exists($remote_storage, $method)) |
|
| 107 | - return false; |
|
| 107 | + if(!method_exists($remote_storage, $method)) { |
|
| 108 | + return false; |
|
| 109 | + } |
|
| 108 | 110 | |
| 109 | 111 | list($adapter, $filesystem) = $remote_storage->$method(); |
| 110 | 112 | |
@@ -153,8 +155,9 @@ discard block |
||
| 153 | 155 | public function get_included_files_handler($metadata = 0) |
| 154 | 156 | { |
| 155 | 157 | $path = $this->included_files_handler; |
| 156 | - if(!$metadata) |
|
| 157 | - return $path; |
|
| 158 | + if(!$metadata) { |
|
| 159 | + return $path; |
|
| 160 | + } |
|
| 158 | 161 | |
| 159 | 162 | $spl_info = $this->getMetadataFull('tmp_adapter', $path); |
| 160 | 163 | return $spl_info; |
@@ -170,31 +173,36 @@ discard block |
||
| 170 | 173 | { |
| 171 | 174 | $files = $this->get_backup_archives_list(); |
| 172 | 175 | |
| 173 | - if(is_array($files)) |
|
| 174 | - $this->sort_by($files, "timestamp","desc"); |
|
| 176 | + if(is_array($files)) { |
|
| 177 | + $this->sort_by($files, "timestamp","desc"); |
|
| 178 | + } |
|
| 175 | 179 | |
| 176 | 180 | $new_list = array(); |
| 177 | 181 | |
| 178 | - foreach($files as $key=>$file) |
|
| 179 | - if(!isset($file['parent'])) |
|
| 182 | + foreach($files as $key=>$file) { |
|
| 183 | + if(!isset($file['parent'])) |
|
| 180 | 184 | $new_list[] = ($files[$key]); |
| 185 | + } |
|
| 181 | 186 | |
| 182 | - if(isset($new_list[0])) |
|
| 183 | - return $new_list[0]; |
|
| 187 | + if(isset($new_list[0])) { |
|
| 188 | + return $new_list[0]; |
|
| 189 | + } |
|
| 184 | 190 | } |
| 185 | 191 | |
| 186 | 192 | public function get_latest_backups() |
| 187 | 193 | { |
| 188 | 194 | $files = $this->get_backup_archives_list(); |
| 189 | 195 | |
| 190 | - if(is_array($files)) |
|
| 191 | - $this->sort_by($files, "timestamp","desc"); |
|
| 196 | + if(is_array($files)) { |
|
| 197 | + $this->sort_by($files, "timestamp","desc"); |
|
| 198 | + } |
|
| 192 | 199 | |
| 193 | 200 | $new_list = array(); |
| 194 | 201 | |
| 195 | - foreach($files as $key=>$file) |
|
| 196 | - if(!isset($file['parent'])) |
|
| 202 | + foreach($files as $key=>$file) { |
|
| 203 | + if(!isset($file['parent'])) |
|
| 197 | 204 | $new_list[] = ($files[$key]); |
| 205 | + } |
|
| 198 | 206 | |
| 199 | 207 | return $new_list; |
| 200 | 208 | } |
@@ -204,25 +212,28 @@ discard block |
||
| 204 | 212 | $files = $this->get_backup_archives_list(); |
| 205 | 213 | $total = 0; |
| 206 | 214 | |
| 207 | - if(is_array($files)) |
|
| 208 | - foreach($files as $file) |
|
| 215 | + if(is_array($files)) { |
|
| 216 | + foreach($files as $file) |
|
| 209 | 217 | $total += $file['size']; |
| 218 | + } |
|
| 210 | 219 | |
| 211 | 220 | return $total; |
| 212 | 221 | } |
| 213 | 222 | |
| 214 | 223 | public function is_part($backup_name) |
| 215 | 224 | { |
| 216 | - if(stristr($backup_name, "-part")) |
|
| 217 | - return true; |
|
| 225 | + if(stristr($backup_name, "-part")) { |
|
| 226 | + return true; |
|
| 227 | + } |
|
| 218 | 228 | |
| 219 | 229 | return false; |
| 220 | 230 | } |
| 221 | 231 | |
| 222 | 232 | public function is_multipart($backup_name) |
| 223 | 233 | { |
| 224 | - if(stristr($backup_name, "-multipart")) |
|
| 225 | - return true; |
|
| 234 | + if(stristr($backup_name, "-multipart")) { |
|
| 235 | + return true; |
|
| 236 | + } |
|
| 226 | 237 | |
| 227 | 238 | return false; |
| 228 | 239 | } |
@@ -233,8 +244,9 @@ discard block |
||
| 233 | 244 | if($this->is_multipart($backup_name)) |
| 234 | 245 | { |
| 235 | 246 | $backup_parts = $this->get_multipart_files($backup_name); |
| 236 | - foreach($backup_parts as $part_file) |
|
| 237 | - $backup_size += $this->get_storage_filesystem()->getSize($part_file); |
|
| 247 | + foreach($backup_parts as $part_file) { |
|
| 248 | + $backup_size += $this->get_storage_filesystem()->getSize($part_file); |
|
| 249 | + } |
|
| 238 | 250 | } |
| 239 | 251 | |
| 240 | 252 | return $backup_size; |
@@ -275,10 +287,11 @@ discard block |
||
| 275 | 287 | } |
| 276 | 288 | } |
| 277 | 289 | |
| 278 | - if($this->get_storage_filesystem($storage_selection)->delete($backup_name)) |
|
| 279 | - $return = true; |
|
| 280 | - else |
|
| 281 | - $return = false; |
|
| 290 | + if($this->get_storage_filesystem($storage_selection)->delete($backup_name)) { |
|
| 291 | + $return = true; |
|
| 292 | + } else { |
|
| 293 | + $return = false; |
|
| 294 | + } |
|
| 282 | 295 | |
| 283 | 296 | return $return; |
| 284 | 297 | } |
@@ -297,8 +310,9 @@ discard block |
||
| 297 | 310 | $list = array(); |
| 298 | 311 | |
| 299 | 312 | |
| 300 | - if(method_exists($this->get_storage_filesystem($storage_selection), "listContents")) |
|
| 301 | - $list = $this->get_storage_filesystem($storage_selection)->listContents(); |
|
| 313 | + if(method_exists($this->get_storage_filesystem($storage_selection), "listContents")) { |
|
| 314 | + $list = $this->get_storage_filesystem($storage_selection)->listContents(); |
|
| 315 | + } |
|
| 302 | 316 | |
| 303 | 317 | |
| 304 | 318 | $backup_files = array(); |
@@ -311,10 +325,11 @@ discard block |
||
| 311 | 325 | $data = array(); |
| 312 | 326 | |
| 313 | 327 | $lines = explode(PHP_EOL, $this->get_storage_filesystem($storage_selection)->read($file_info['path'])); |
| 314 | - foreach($lines as $line) |
|
| 315 | - if($line) |
|
| 328 | + foreach($lines as $line) { |
|
| 329 | + if($line) |
|
| 316 | 330 | { |
| 317 | 331 | $data = str_getcsv($line); |
| 332 | + } |
|
| 318 | 333 | if(is_array($data)){ |
| 319 | 334 | $parents[$data[0]] = $file_info['basename']; |
| 320 | 335 | $file_info['childs'][] = $data; |
@@ -324,8 +339,9 @@ discard block |
||
| 324 | 339 | |
| 325 | 340 | } |
| 326 | 341 | |
| 327 | - if($file_info['type'] == 'file' and isset($file_info['extension']) and in_array($file_info['extension'], $this->backup_archive_extensions)) |
|
| 328 | - $backup_files[$file_info['path']] = $file_info; |
|
| 342 | + if($file_info['type'] == 'file' and isset($file_info['extension']) and in_array($file_info['extension'], $this->backup_archive_extensions)) { |
|
| 343 | + $backup_files[$file_info['path']] = $file_info; |
|
| 344 | + } |
|
| 329 | 345 | } |
| 330 | 346 | |
| 331 | 347 | foreach($backup_files as $key=>$file_info) |
@@ -335,8 +351,9 @@ discard block |
||
| 335 | 351 | //$backup_files[$key]['timestamp'] = $this->get_storage_filesystem($storage_selection)->getTimestamp($file_info['path']); |
| 336 | 352 | } |
| 337 | 353 | |
| 338 | - if(isset($parents[$file_info['basename']])) |
|
| 339 | - $backup_files[$key]['parent'] = $parents[$file_info['basename']]; |
|
| 354 | + if(isset($parents[$file_info['basename']])) { |
|
| 355 | + $backup_files[$key]['parent'] = $parents[$file_info['basename']]; |
|
| 356 | + } |
|
| 340 | 357 | } |
| 341 | 358 | |
| 342 | 359 | return $backup_files; |
@@ -362,11 +379,11 @@ discard block |
||
| 362 | 379 | if($counter < $this->folders_to_process_per_session){ |
| 363 | 380 | $this->build_files_list($file); |
| 364 | 381 | $counter++; |
| 365 | - }else{ |
|
| 382 | + } else{ |
|
| 366 | 383 | $this->tmp_filesystem_append->write($this->get_temp_dir_handler(), $file."\n"); |
| 367 | 384 | } |
| 368 | 385 | } |
| 369 | - }else{ |
|
| 386 | + } else{ |
|
| 370 | 387 | $this->build_files_list(); |
| 371 | 388 | } |
| 372 | 389 | |
@@ -408,8 +425,9 @@ discard block |
||
| 408 | 425 | { |
| 409 | 426 | $return = array(); |
| 410 | 427 | $return[] = $this->xcloner_settings->get_xcloner_tmp_path().DS.$this->get_included_files_handler(); |
| 411 | - if($this->xcloner_settings->get_xcloner_option('xcloner_enable_log')) |
|
| 412 | - $return[] = $this->xcloner_settings->get_xcloner_tmp_path().DS.$this->xcloner_settings->get_logger_filename(1); |
|
| 428 | + if($this->xcloner_settings->get_xcloner_option('xcloner_enable_log')) { |
|
| 429 | + $return[] = $this->xcloner_settings->get_xcloner_tmp_path().DS.$this->xcloner_settings->get_logger_filename(1); |
|
| 430 | + } |
|
| 413 | 431 | |
| 414 | 432 | return $return; |
| 415 | 433 | } |
@@ -421,9 +439,10 @@ discard block |
||
| 421 | 439 | |
| 422 | 440 | $contents = $this->get_tmp_filesystem()->listContents(); |
| 423 | 441 | |
| 424 | - if(is_array($contents)) |
|
| 425 | - foreach($contents as $file_info) |
|
| 442 | + if(is_array($contents)) { |
|
| 443 | + foreach($contents as $file_info) |
|
| 426 | 444 | $this->get_tmp_filesystem()->delete($file_info['path']); |
| 445 | + } |
|
| 427 | 446 | |
| 428 | 447 | @rmdir($this->xcloner_settings->get_xcloner_tmp_path()); |
| 429 | 448 | |
@@ -434,17 +453,21 @@ discard block |
||
| 434 | 453 | { |
| 435 | 454 | $this->files_counter = 0; |
| 436 | 455 | |
| 437 | - if(!$this->storage_filesystem->has("index.html")) |
|
| 438 | - $this->storage_filesystem->write("index.html",""); |
|
| 456 | + if(!$this->storage_filesystem->has("index.html")) { |
|
| 457 | + $this->storage_filesystem->write("index.html",""); |
|
| 458 | + } |
|
| 439 | 459 | |
| 440 | - if(!$this->tmp_filesystem->has("index.html")) |
|
| 441 | - $this->tmp_filesystem->write("index.html",""); |
|
| 460 | + if(!$this->tmp_filesystem->has("index.html")) { |
|
| 461 | + $this->tmp_filesystem->write("index.html",""); |
|
| 462 | + } |
|
| 442 | 463 | |
| 443 | - if($this->tmp_filesystem->has($this->get_included_files_handler())) |
|
| 444 | - $this->tmp_filesystem->delete($this->get_included_files_handler()); |
|
| 464 | + if($this->tmp_filesystem->has($this->get_included_files_handler())) { |
|
| 465 | + $this->tmp_filesystem->delete($this->get_included_files_handler()); |
|
| 466 | + } |
|
| 445 | 467 | |
| 446 | - if($this->tmp_filesystem->has($this->get_temp_dir_handler())) |
|
| 447 | - $this->tmp_filesystem->delete($this->get_temp_dir_handler()); |
|
| 468 | + if($this->tmp_filesystem->has($this->get_temp_dir_handler())) { |
|
| 469 | + $this->tmp_filesystem->delete($this->get_temp_dir_handler()); |
|
| 470 | + } |
|
| 448 | 471 | } |
| 449 | 472 | |
| 450 | 473 | public function get_scanned_files_num() |
@@ -464,8 +487,9 @@ discard block |
||
| 464 | 487 | |
| 465 | 488 | public function set_excluded_files($excluded_files = array()) |
| 466 | 489 | { |
| 467 | - if(!is_array($excluded_files)) |
|
| 468 | - $excluded_files = array(); |
|
| 490 | + if(!is_array($excluded_files)) { |
|
| 491 | + $excluded_files = array(); |
|
| 492 | + } |
|
| 469 | 493 | |
| 470 | 494 | $this->excluded_files = array_merge($excluded_files, $this->excluded_files_by_default); |
| 471 | 495 | |
@@ -499,21 +523,21 @@ discard block |
||
| 499 | 523 | if(!is_readable($this->xcloner_settings->get_xcloner_start_path().DS.$file['path'])) |
| 500 | 524 | { |
| 501 | 525 | $this->logger->info(sprintf(__("Excluding %s from the filesystem list, file not readable"), $file['path']), array("FILESYSTEM SCAN","NOT READABLE")); |
| 502 | - } |
|
| 503 | - elseif(!$matching_pattern = $this->is_excluded($file) ){ |
|
| 526 | + } elseif(!$matching_pattern = $this->is_excluded($file) ){ |
|
| 504 | 527 | $this->logger->info(sprintf(__("Adding %s to the filesystem list"), $file['path']), array("FILESYSTEM SCAN","INCLUDE")); |
| 505 | 528 | $file['visibility'] = $this->start_filesystem->getVisibility($file['path']); |
| 506 | 529 | $this->store_file($file); |
| 507 | 530 | $this->files_counter++; |
| 508 | - if(isset($file['size'])) |
|
| 509 | - $this->files_size += $file['size']; |
|
| 531 | + if(isset($file['size'])) { |
|
| 532 | + $this->files_size += $file['size']; |
|
| 533 | + } |
|
| 510 | 534 | |
| 511 | - }else{ |
|
| 535 | + } else{ |
|
| 512 | 536 | $this->logger->info(sprintf(__("Excluding %s from the filesystem list, matching pattern %s"), $file['path'], $matching_pattern), array("FILESYSTEM SCAN","EXCLUDE")); |
| 513 | 537 | } |
| 514 | 538 | } |
| 515 | 539 | |
| 516 | - }catch(Exception $e){ |
|
| 540 | + } catch(Exception $e){ |
|
| 517 | 541 | |
| 518 | 542 | $this->logger->error($e->getMessage()); |
| 519 | 543 | |
@@ -540,7 +564,7 @@ discard block |
||
| 540 | 564 | |
| 541 | 565 | $this->tmp_filesystem->delete($tmp_file); |
| 542 | 566 | |
| 543 | - }catch(Exception $e){ |
|
| 567 | + } catch(Exception $e){ |
|
| 544 | 568 | |
| 545 | 569 | $this->logger->error($e->getMessage()); |
| 546 | 570 | |
@@ -561,12 +585,14 @@ discard block |
||
| 561 | 585 | |
| 562 | 586 | $files = $this->storage_filesystem->listContents(); |
| 563 | 587 | |
| 564 | - if(is_array($files)) |
|
| 565 | - foreach($files as $file) |
|
| 588 | + if(is_array($files)) { |
|
| 589 | + foreach($files as $file) |
|
| 566 | 590 | { |
| 567 | 591 | if(isset($file['extension']) and in_array($file['extension'], $this->backup_archive_extensions)) |
| 568 | 592 | { |
| 569 | - $_storage_size += $file['size']; //bytes |
|
| 593 | + $_storage_size += $file['size']; |
|
| 594 | + } |
|
| 595 | + //bytes |
|
| 570 | 596 | $_backup_files_list[] = $file; |
| 571 | 597 | } |
| 572 | 598 | } |
@@ -580,9 +606,11 @@ discard block |
||
| 580 | 606 | { |
| 581 | 607 | //processing rule folder capacity |
| 582 | 608 | if($this->xcloner_settings->get_xcloner_option('xcloner_cleanup_capacity_limit') && |
| 583 | - $_storage_size >= ($set_storage_limit = 1024*1024*$this->xcloner_settings->get_xcloner_option('xcloner_cleanup_capacity_limit'))) //bytes |
|
| 609 | + $_storage_size >= ($set_storage_limit = 1024*1024*$this->xcloner_settings->get_xcloner_option('xcloner_cleanup_capacity_limit'))) { |
|
| 610 | + //bytes |
|
| 584 | 611 | { |
| 585 | 612 | $this->storage_filesystem->delete($file['path']); |
| 613 | + } |
|
| 586 | 614 | $_storage_size -= $file['size']; |
| 587 | 615 | $this->logger->info("Deleting backup ".$file['path']." matching rule", array("STORAGE SIZE LIMIT", $_storage_size." >= ".$set_storage_limit)); |
| 588 | 616 | } |
@@ -623,34 +651,37 @@ discard block |
||
| 623 | 651 | |
| 624 | 652 | public function process_backup_name($name = "", $max_length=100) |
| 625 | 653 | { |
| 626 | - if(!$name) |
|
| 627 | - $name = $this->xcloner_settings->get_default_backup_name(); |
|
| 654 | + if(!$name) { |
|
| 655 | + $name = $this->xcloner_settings->get_default_backup_name(); |
|
| 656 | + } |
|
| 628 | 657 | |
| 629 | 658 | foreach($this->backup_name_tags as $tag) |
| 630 | 659 | { |
| 631 | - if($tag == '[time]') |
|
| 632 | - $name = str_replace($tag, date("Y-m-d_H-i"),$name); |
|
| 633 | - elseif($tag == '[hostname]') |
|
| 634 | - $name = str_replace($tag, gethostname() ,$name); |
|
| 635 | - elseif($tag == '[domain]') |
|
| 660 | + if($tag == '[time]') { |
|
| 661 | + $name = str_replace($tag, date("Y-m-d_H-i"),$name); |
|
| 662 | + } elseif($tag == '[hostname]') { |
|
| 663 | + $name = str_replace($tag, gethostname() ,$name); |
|
| 664 | + } elseif($tag == '[domain]') |
|
| 636 | 665 | { |
| 637 | 666 | $domain = parse_url(admin_url(), PHP_URL_HOST); |
| 638 | 667 | $name = str_replace($tag, $domain ,$name); |
| 639 | 668 | } |
| 640 | 669 | } |
| 641 | 670 | |
| 642 | - if($max_length) |
|
| 643 | - $name = substr($name, 0, $max_length); |
|
| 671 | + if($max_length) { |
|
| 672 | + $name = substr($name, 0, $max_length); |
|
| 673 | + } |
|
| 644 | 674 | |
| 645 | 675 | return $name; |
| 646 | 676 | } |
| 647 | 677 | |
| 648 | 678 | public function sort_by( &$array, $field, $direction = 'asc') |
| 649 | 679 | { |
| 650 | - if(strtolower($direction) == "desc" || $direction == SORT_DESC) |
|
| 651 | - $direction = SORT_DESC; |
|
| 652 | - else |
|
| 653 | - $direction = SORT_ASC; |
|
| 680 | + if(strtolower($direction) == "desc" || $direction == SORT_DESC) { |
|
| 681 | + $direction = SORT_DESC; |
|
| 682 | + } else { |
|
| 683 | + $direction = SORT_ASC; |
|
| 684 | + } |
|
| 654 | 685 | |
| 655 | 686 | $array = $this->array_orderby($array, $field, $direction); |
| 656 | 687 | |
@@ -667,10 +698,11 @@ discard block |
||
| 667 | 698 | $tmp = array(); |
| 668 | 699 | foreach ($data as $key => $row) |
| 669 | 700 | { |
| 670 | - if(is_array($row)) |
|
| 671 | - $tmp[$key] = $row[$field]; |
|
| 672 | - else |
|
| 673 | - $tmp[$key] = $row->$field; |
|
| 701 | + if(is_array($row)) { |
|
| 702 | + $tmp[$key] = $row[$field]; |
|
| 703 | + } else { |
|
| 704 | + $tmp[$key] = $row->$field; |
|
| 705 | + } |
|
| 674 | 706 | } |
| 675 | 707 | $args[$n] = $tmp; |
| 676 | 708 | } |
@@ -688,28 +720,32 @@ discard block |
||
| 688 | 720 | |
| 689 | 721 | if($xcloner_exclude_files_larger_than_mb = $this->xcloner_settings->get_xcloner_option('xcloner_exclude_files_larger_than_mb')) |
| 690 | 722 | { |
| 691 | - if(isset($file['size']) && $file['size'] > $this->calc_to_bytes($xcloner_exclude_files_larger_than_mb)) |
|
| 692 | - return "> ".$xcloner_exclude_files_larger_than_mb."MB"; |
|
| 723 | + if(isset($file['size']) && $file['size'] > $this->calc_to_bytes($xcloner_exclude_files_larger_than_mb)) { |
|
| 724 | + return "> ".$xcloner_exclude_files_larger_than_mb."MB"; |
|
| 725 | + } |
|
| 693 | 726 | } |
| 694 | 727 | |
| 695 | - if(!sizeof($this->excluded_files)) |
|
| 696 | - $this->set_excluded_files(); |
|
| 728 | + if(!sizeof($this->excluded_files)) { |
|
| 729 | + $this->set_excluded_files(); |
|
| 730 | + } |
|
| 697 | 731 | |
| 698 | - if(is_array($this->excluded_files)) |
|
| 699 | - foreach($this->excluded_files as $excluded_file_pattern) |
|
| 732 | + if(is_array($this->excluded_files)) { |
|
| 733 | + foreach($this->excluded_files as $excluded_file_pattern) |
|
| 700 | 734 | { |
| 701 | 735 | if($excluded_file_pattern == "/") |
| 702 | 736 | $needle = "$"; |
| 703 | - else |
|
| 704 | - $needle = "$".$excluded_file_pattern; |
|
| 737 | + } else { |
|
| 738 | + $needle = "$".$excluded_file_pattern; |
|
| 739 | + } |
|
| 705 | 740 | |
| 706 | 741 | if(strstr("$".$file['path'], $needle)){ |
| 707 | 742 | return $excluded_file_pattern; |
| 708 | 743 | } |
| 709 | 744 | } |
| 710 | 745 | |
| 711 | - if( $regex = $this->is_excluded_regex($file)) |
|
| 712 | - return $regex; |
|
| 746 | + if( $regex = $this->is_excluded_regex($file)) { |
|
| 747 | + return $regex; |
|
| 748 | + } |
|
| 713 | 749 | |
| 714 | 750 | return false; |
| 715 | 751 | } |
@@ -763,13 +799,15 @@ discard block |
||
| 763 | 799 | foreach($regex_patterns as $excluded_file_pattern) |
| 764 | 800 | { |
| 765 | 801 | |
| 766 | - if( substr($excluded_file_pattern, strlen($excluded_file_pattern)-1, strlen($excluded_file_pattern)) == "\r") |
|
| 767 | - $excluded_file_pattern = substr($excluded_file_pattern, 0, strlen($excluded_file_pattern)-1); |
|
| 802 | + if( substr($excluded_file_pattern, strlen($excluded_file_pattern)-1, strlen($excluded_file_pattern)) == "\r") { |
|
| 803 | + $excluded_file_pattern = substr($excluded_file_pattern, 0, strlen($excluded_file_pattern)-1); |
|
| 804 | + } |
|
| 768 | 805 | |
| 769 | - if($file['path'] == "/") |
|
| 770 | - $needle = "/"; |
|
| 771 | - else |
|
| 772 | - $needle = "/".$file['path']; |
|
| 806 | + if($file['path'] == "/") { |
|
| 807 | + $needle = "/"; |
|
| 808 | + } else { |
|
| 809 | + $needle = "/".$file['path']; |
|
| 810 | + } |
|
| 773 | 811 | //echo $needle."---".$excluded_file_pattern."---\n"; |
| 774 | 812 | |
| 775 | 813 | if(@preg_match("/(^|^\/)".$excluded_file_pattern."/i", $needle)){ |
@@ -785,10 +823,12 @@ discard block |
||
| 785 | 823 | { |
| 786 | 824 | $this->logger->debug(sprintf("Storing %s in the backup list", $file['path'])); |
| 787 | 825 | |
| 788 | - if(!isset($file['size'])) |
|
| 789 | - $file['size'] = 0; |
|
| 790 | - if(!isset($file['visibility'])) |
|
| 791 | - $file['visibility'] = "private"; |
|
| 826 | + if(!isset($file['size'])) { |
|
| 827 | + $file['size'] = 0; |
|
| 828 | + } |
|
| 829 | + if(!isset($file['visibility'])) { |
|
| 830 | + $file['visibility'] = "private"; |
|
| 831 | + } |
|
| 792 | 832 | |
| 793 | 833 | $csv_filename = str_replace('"','""', $file['path']); |
| 794 | 834 | |
@@ -806,7 +846,7 @@ discard block |
||
| 806 | 846 | |
| 807 | 847 | $this->tmp_filesystem_append->write($this->get_included_files_handler(), $line); |
| 808 | 848 | |
| 809 | - }catch(Exception $e){ |
|
| 849 | + } catch(Exception $e){ |
|
| 810 | 850 | |
| 811 | 851 | $this->logger->error($e->getMessage()); |
| 812 | 852 | } |
@@ -814,7 +854,7 @@ discard block |
||
| 814 | 854 | if($file['type'] == "dir"){ |
| 815 | 855 | try{ |
| 816 | 856 | $this->tmp_filesystem_append->write($this->get_temp_dir_handler(), $file['path']."\n"); |
| 817 | - }catch(Exception $e){ |
|
| 857 | + } catch(Exception $e){ |
|
| 818 | 858 | $this->logger->error($e->getMessage()); |
| 819 | 859 | } |
| 820 | 860 | } |
@@ -827,35 +867,39 @@ discard block |
||
| 827 | 867 | |
| 828 | 868 | public function get_filesystem($system = "") |
| 829 | 869 | { |
| 830 | - if($system == "storage_filesystem_append") |
|
| 831 | - return $this->storage_filesystem_append; |
|
| 832 | - elseif($system == "tmp_filesystem_append") |
|
| 833 | - return $this->tmp_filesystem_append; |
|
| 834 | - elseif($system == "tmp_filesystem") |
|
| 835 | - return $this->tmp_filesystem; |
|
| 836 | - elseif($system == "storage_filesystem") |
|
| 837 | - return $this->storage_filesystem; |
|
| 838 | - else |
|
| 839 | - return $this->start_filesystem; |
|
| 870 | + if($system == "storage_filesystem_append") { |
|
| 871 | + return $this->storage_filesystem_append; |
|
| 872 | + } elseif($system == "tmp_filesystem_append") { |
|
| 873 | + return $this->tmp_filesystem_append; |
|
| 874 | + } elseif($system == "tmp_filesystem") { |
|
| 875 | + return $this->tmp_filesystem; |
|
| 876 | + } elseif($system == "storage_filesystem") { |
|
| 877 | + return $this->storage_filesystem; |
|
| 878 | + } else { |
|
| 879 | + return $this->start_filesystem; |
|
| 880 | + } |
|
| 840 | 881 | } |
| 841 | 882 | |
| 842 | 883 | public function get_adapter($system) |
| 843 | 884 | { |
| 844 | - if($system == "tmp_filesystem") |
|
| 845 | - return $this->tmp_adapter; |
|
| 846 | - elseif($system == "storage_filesystem") |
|
| 847 | - return $this->storage_adapter; |
|
| 848 | - else |
|
| 849 | - return $this->start_adapter; |
|
| 885 | + if($system == "tmp_filesystem") { |
|
| 886 | + return $this->tmp_adapter; |
|
| 887 | + } elseif($system == "storage_filesystem") { |
|
| 888 | + return $this->storage_adapter; |
|
| 889 | + } else { |
|
| 890 | + return $this->start_adapter; |
|
| 891 | + } |
|
| 850 | 892 | } |
| 851 | 893 | |
| 852 | 894 | private function scan_finished() |
| 853 | 895 | { |
| 854 | - if($this->tmp_filesystem_append->has($this->get_temp_dir_handler()) && $this->tmp_filesystem_append->getSize($this->get_temp_dir_handler())) |
|
| 855 | - return false; |
|
| 896 | + if($this->tmp_filesystem_append->has($this->get_temp_dir_handler()) && $this->tmp_filesystem_append->getSize($this->get_temp_dir_handler())) { |
|
| 897 | + return false; |
|
| 898 | + } |
|
| 856 | 899 | |
| 857 | - if($this->tmp_filesystem->has($this->get_temp_dir_handler())) |
|
| 858 | - $this->tmp_filesystem->delete($this->get_temp_dir_handler()); |
|
| 900 | + if($this->tmp_filesystem->has($this->get_temp_dir_handler())) { |
|
| 901 | + $this->tmp_filesystem->delete($this->get_temp_dir_handler()); |
|
| 902 | + } |
|
| 859 | 903 | |
| 860 | 904 | $this->logger->debug(sprintf(("File scan finished"))); |
| 861 | 905 | |