Changeset 1466192
- Timestamp:
- 08/02/2016 02:01:46 PM (8 years ago)
- Location:
- backupwordpress/trunk
- Files:
-
- 2 added
- 23 edited
Legend:
- Unmodified
- Added
- Removed
-
backupwordpress/trunk/admin/actions.php
r1383488 r1466192 412 412 413 413 $schedule->save(); 414 414 415 415 416 wp_safe_redirect( wp_get_referer(), '303' ); … … 442 443 443 444 $schedule->save(); 445 444 446 445 447 wp_safe_redirect( wp_get_referer(), '303' ); -
backupwordpress/trunk/admin/schedule-form-excludes.php
r1383488 r1466192 3 3 namespace HM\BackUpWordPress; 4 4 5 $excludes = $schedule->get_excludes();5 $excludes = $schedule->get_excludes(); 6 6 $user_excludes = $excludes->get_user_excludes(); ?> 7 7 … … 9 9 10 10 <h3> 11 <?php _e( 'Currently Excluded', 'backupwordpress' ); ?>11 <?php _e( 'Currently Excluded', 'backupwordpress' ); ?> 12 12 </h3> 13 13 14 <p><?php _e( 'We automatically detect and ignore common <abbr title="Version Control Systems">VCS</abbr> folders and other backup plugin folders.', 'backupwordpress' ); ?></p> 14 <p> 15 <?php esc_html_e( 'We automatically detect and ignore common Version Control Systems folders and other backup plugin folders.', 'backupwordpress' ); ?> 16 </p> 15 17 16 18 <table class="widefat"> … … 46 48 <td> 47 49 48 <?php if ( ( in_array( $exclude, $excludes->get_default_excludes() ) ) || ( Path::get_path() === trailingslashit( Path::get_root() ) . untrailingslashit( $exclude ) ) ) : ?> 49 50 <?php _e( 'Default rule', 'backupwordpress' ); ?> 50 <?php if ( 51 ( in_array( $exclude, $excludes->get_default_excludes() ) ) || 52 ( Path::get_path() === trailingslashit( Path::get_root() ) . untrailingslashit( $exclude ) ) 53 ) : ?> 54 55 <?php esc_html_e( 'Default rule', 'backupwordpress' ); ?> 51 56 52 57 <?php elseif ( defined( 'HMBKP_EXCLUDE' ) && false !== strpos( HMBKP_EXCLUDE, $exclude ) ) : ?> 53 58 54 <?php _e( 'Defined in wp-config.php', 'backupwordpress' ); ?>59 <?php ' ); ?> 55 60 56 61 <?php else : ?> … … 59 64 'hmbkp_remove_exclude' => $exclude, 60 65 'hmbkp_schedule_id' => $schedule->get_id(), 61 ) ); ?>" class="delete-action"><?php _e( 'Stop excluding', 'backupwordpress' ); ?></a> 66 ) ); ?>" class="delete-action"> 67 <?php esc_html_e( 'Stop excluding', 'backupwordpress' ); ?> 68 </a> 62 69 63 70 <?php endif; ?> … … 73 80 </table> 74 81 75 <h3 id="directory-listing"><?php _e( 'Your Site', 'backupwordpress' ); ?></h3> 76 77 <p><?php _e( 'Here\'s a directory listing of all files on your site, you can browse through and exclude files or folders that you don\'t want included in your backup.', 'backupwordpress' ); ?></p> 82 <h3 id="directory-listing"> 83 <?php esc_html_e( 'Your Site', 'backupwordpress' ); ?> 84 </h3> 85 86 <p> 87 <?php esc_html_e( 'Here\'s a directory listing of all files on your site, you can browse through and exclude files or folders that you don\'t want included in your backup.', 'backupwordpress' ); ?> 88 </p> 78 89 79 90 <?php 80 91 81 // The directory to display 92 // The directory to display 82 93 $directory = Path::get_root(); 83 94 84 if ( isset( $_GET['hmbkp_directory_browse'] ) ) :95 if ( isset( $_GET['hmbkp_directory_browse'] ) ) 85 96 86 97 $untrusted_directory = urldecode( $_GET['hmbkp_directory_browse'] ); 87 98 88 // Only allow real sub directories of the site root to be browsed 89 if ( false !== strpos( $untrusted_directory, Path::get_root() ) && is_dir( $untrusted_directory ) ) : 99 // Only allow real sub directories of the site root to be browsed. 100 if ( 101 false !== strpos( $untrusted_directory, Path::get_root() ) && 102 is_dir( $untrusted_directory ) 103 ) { 90 104 $directory = $untrusted_directory; 91 endif;92 endif;105 106 93 107 94 108 $exclude_string = implode( '|', $excludes->get_excludes_for_regex() ); 95 109 96 $site_size = new Site_Size( 'file' );110 $site_size = new Site_Size( 'file' ); 97 111 $excluded_site_size = new Site_Size( 'file', $excludes ); 98 112 99 // Kick off a recursive filesize scan 100 $files = list_directory_by_total_filesize( $directory, $excludes ); ?> 113 // Kick off a recursive filesize scan. 114 $files = list_directory_by_total_filesize( $directory, $excludes ); 115 ?> 101 116 102 117 <table class="widefat"> … … 106 121 <tr> 107 122 <th></th> 108 <th scope="col"><?php _e( 'Name', 'backupwordpress' ); ?></th>109 <th scope="col" class="column-format"><?php _e( 'Included Size', 'backupwordpress' ); ?></th>110 <th scope="col" class="column-format"><?php _e( 'Permissions', 'backupwordpress' ); ?></th>111 <th scope="col" class="column-format"><?php _e( 'Type', 'backupwordpress' ); ?></th>112 <th scope="col" class="column-format"><?php _e( 'Status', 'backupwordpress' ); ?></th>123 <th scope="col"><?php _e( 'Name', 'backupwordpress' ); ?></th> 124 <th scope="col" class="column-format"><?php _e( 'Included Size', 'backupwordpress' ); ?></th> 125 <th scope="col" class="column-format"><?php _e( 'Permissions', 'backupwordpress' ); ?></th> 126 <th scope="col" class="column-format"><?php _e( 'Type', 'backupwordpress' ); ?></th> 127 <th scope="col" class="column-format"><?php _e( 'Status', 'backupwordpress' ); ?></th> 113 128 </tr> 114 129 … … 123 138 <?php if ( Path::get_root() !== $directory ) : ?> 124 139 125 <a href="<?php echo esc_url( remove_query_arg( 'hmbkp_directory_browse' ) ); ?>"><?php echo esc_html( Path::get_root() ); ?></a> 140 <a href="<?php echo esc_url( remove_query_arg( 'hmbkp_directory_browse' ) ); ?>"> 141 <?php echo esc_html( Path::get_root() ); ?> 142 </a> 126 143 <code>/</code> 127 144 128 <?php $parents = array_filter( explode( '/', str_replace( trailingslashit( Path::get_root() ), '', trailingslashit( dirname( $directory ) ) ) ) ); 145 <?php 146 $parents = array_filter( explode( 147 '/', 148 str_replace( trailingslashit( Path::get_root() ), '', trailingslashit( dirname( $directory ) ) ) 149 ) ); 129 150 130 151 foreach ( $parents as $directory_basename ) : ?> 131 152 132 <a href="<?php echo esc_url( add_query_arg( 'hmbkp_directory_browse', urlencode( substr( $directory, 0, strpos( $directory, $directory_basename ) ) . $directory_basename ) ) ); ?>"><?php echo esc_html( $directory_basename ); ?></a> 153 <a href="<?php echo esc_url( add_query_arg( 'hmbkp_directory_browse', urlencode( substr( $directory, 0, strpos( $directory, $directory_basename ) ) . $directory_basename ) ) ); ?>"> 154 <?php echo esc_html( $directory_basename ); ?> 155 </a> 133 156 <code>/</code> 134 157 … … 153 176 <?php else : 154 177 155 $root = new \SplFileInfo( Path::get_root() ); 156 157 $size = $site_size->filesize( $root ); 158 $excluded_size = $excluded_site_size->filesize( $root ); ?> 178 $root = new \SplFileInfo( Path::get_root() ); 179 $size = $site_size->filesize( $root ); 180 $excluded_size = $excluded_site_size->filesize( $root ); 181 $excluded_size = is_same_size_format( $size, $excluded_size ) ? (int) size_format( $excluded_size ) : size_format( $excluded_size ); 182 ?> 159 183 160 184 <code> 161 <?php $excluded_size = is_same_size_format( $size, $excluded_size ) ? (int) size_format( $excluded_size ) : size_format( $excluded_size ); ?> 162 <?php echo sprintf( __( '%s of %s', 'backupwordpress' ), esc_html( $excluded_size ), esc_html( size_format( $size ) ) ); ?> 163 <a class="dashicons dashicons-update" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'hmbkp_recalculate_directory_filesize', urlencode( Path::get_root() ) ), 'hmbkp-recalculate_directory_filesize' ) ); ?>"><span><?php _e( 'Refresh', 'backupwordpress' ); ?></span></a> 185 <?php 186 /* translators: 1: Excluded size 2: Overall site size */ 187 printf( 188 esc_html__( '%1$s of %2$s', 'backupwordpress' ), 189 esc_html( $excluded_size ), 190 esc_html( size_format( $size ) ) 191 ); 192 ?> 193 194 <a class="dashicons dashicons-update" href="<?php echo esc_url( wp_nonce_url( add_query_arg( 'hmbkp_recalculate_directory_filesize', urlencode( Path::get_root() ) ), 'hmbkp-recalculate_directory_filesize' ) ); ?>"> 195 <span><?php esc_html_e( 'Refresh', 'backupwordpress' ); ?></span> 196 </a> 164 197 </code> 165 198 … … 175 208 176 209 <?php if ( is_link( Path::get_root() ) ) : 177 _e( 'Symlink', 'backupwordpress' );210 _e( 'Symlink', 'backupwordpress' ); 178 211 elseif ( is_dir( Path::get_root() ) ) : 179 _e( 'Folder', 'backupwordpress' );212 _e( 'Folder', 'backupwordpress' ); 180 213 endif; ?> 181 214 … … 198 231 $is_excluded = $is_unreadable = false; 199 232 200 // Check if the file is excluded 201 if ( $exclude_string && preg_match( '(' . $exclude_string . ')', str_ireplace( trailingslashit( Path::get_root() ), '', wp_normalize_path( $file->getPathname() ) ) ) ) : 233 // Check if the file is excluded. 234 if ( 235 $exclude_string && 236 preg_match( '(' . $exclude_string . ')', str_ireplace( trailingslashit( Path::get_root() ), '', wp_normalize_path( $file->getPathname() ) ) ) 237 ) : 202 238 $is_excluded = true; 203 239 endif; 204 240 205 // Skip unreadable files 241 // Skip unreadable files 206 242 if ( ! @realpath( $file->getPathname() ) || ! $file->isReadable() ) : 207 243 $is_unreadable = true; 208 endif; ?> 244 endif; 245 ?> 209 246 210 247 <tr> … … 232 269 <?php if ( $is_unreadable ) : ?> 233 270 234 <code class="strikethrough" title="<?php echo esc_attr( wp_normalize_path( $file->getRealPath() ) ); ?>"><?php echo esc_html( $file->getBasename() ); ?></code> 271 <code class="strikethrough" title="<?php echo esc_attr( wp_normalize_path( $file->getRealPath() ) ); ?>"> 272 <?php echo esc_html( $file->getBasename() ); ?> 273 </code> 235 274 236 275 <?php elseif ( $file->isFile() ) : ?> 237 276 238 <code title="<?php echo esc_attr( wp_normalize_path( $file->getRealPath() ) ); ?>"><?php echo esc_html( $file->getBasename() ); ?></code> 277 <code title="<?php echo esc_attr( wp_normalize_path( $file->getRealPath() ) ); ?>"> 278 <?php echo esc_html( $file->getBasename() ); ?> 279 </code> 239 280 240 281 <?php elseif ( $file->isDir() ) : ?> 241 282 242 <code title="<?php echo esc_attr( wp_normalize_path( $file->getRealPath() ) ); ?>"><a href="<?php echo esc_url( add_query_arg( 'hmbkp_directory_browse', urlencode( wp_normalize_path( $file->getPathname() ) ) ) ); ?>"><?php echo esc_html( $file->getBasename() ); ?></a></code> 283 <code title="<?php echo esc_attr( wp_normalize_path( $file->getRealPath() ) ); ?>"> 284 <a href="<?php echo esc_url( add_query_arg( 'hmbkp_directory_browse', urlencode( wp_normalize_path( $file->getPathname() ) ) ) ); ?>"> 285 <?php echo esc_html( $file->getBasename() ); ?> 286 </a> 287 </code> 243 288 244 289 <?php endif; ?> … … 254 299 255 300 if ( false !== $size ) : 256 $size = size_format( $size ) ?: '0 B';257 $excluded_size = size_format( $excluded_site_size->filesize( $file )) ?: '0'; ?>301 $size '; 302 $excluded_size = ) ?: '0'; ?> 258 303 259 304 <code> 260 305 261 306 <?php if ( $file->isDir() ) : 307 262 308 $excluded_size = is_same_size_format( $size, $excluded_size ) ? (int) size_format( $excluded_size ) : size_format( $excluded_size ); 263 echo sprintf( __( '%s of %s', 'backupwordpress' ), esc_html( $excluded_size ), esc_html( size_format( $size ) ) ); 309 310 /* translators: 1: Excluded size 2: Overall site size */ 311 printf( 312 esc_html__( '%1$s of %2$s', 'backupwordpress' ), 313 esc_html( $excluded_size ), 314 esc_html( size_format( $size ) ) 315 ); 316 264 317 elseif ( ! $is_unreadable ) : 265 echo esc_html( $size);318 echo esc_html( ); 266 319 else : 267 320 echo '-'; … … 275 328 276 329 <?php endif; 277 endif; ?> 330 endif; 331 ?> 278 332 279 333 </td> … … 292 346 <code> 293 347 <?php if ( $file->isLink() ) : ?> 294 <span title="<?php echo esc_attr( wp_normalize_path( $file->getRealPath() ) ); ?>"><?php _e( 'Symlink', 'backupwordpress' ); ?></span> 348 <span title="<?php echo esc_attr( wp_normalize_path( $file->getRealPath() ) ); ?>"> 349 <?php esc_html_e( 'Symlink', 'backupwordpress' ); ?> 350 </span> 295 351 <?php elseif ( $file->isDir() ) : 296 _e( 'Folder', 'backupwordpress' );352 _e( 'Folder', 'backupwordpress' ); 297 353 else : 298 _e( 'File', 'backupwordpress' );354 _e( 'File', 'backupwordpress' ); 299 355 endif; ?> 300 356 </code> … … 305 361 <?php if ( $is_unreadable ) : ?> 306 362 307 <strong title="<?php _e( 'Unreadable files won\'t be backed up.', 'backupwordpress' ); ?>"><?php _e( 'Unreadable', 'backupwordpress' ); ?></strong> 363 <strong title="<?php esc_attr_e( 'Unreadable files won\'t be backed up.', 'backupwordpress' ); ?>"> 364 <?php esc_html_e( 'Unreadable', 'backupwordpress' ); ?> 365 </strong> 308 366 309 367 <?php elseif ( $is_excluded ) : ?> 310 368 311 <strong><?php _e( 'Excluded', 'backupwordpress' ); ?></strong>369 <strong><?php _e( 'Excluded', 'backupwordpress' ); ?></strong> 312 370 313 371 <?php else : … … 315 373 $exclude_path = $file->getPathname(); 316 374 317 // Excluded directories need to be trailingslashed 375 // Excluded directories need to be trailingslashed 318 376 if ( $file->isDir() ) : 319 377 $exclude_path = trailingslashit( wp_normalize_path( $file->getPathname() ) ); 320 378 endif; ?> 321 379 322 <a href="<?php echo esc_url( wp_nonce_url( add_query_arg( array( 323 'hmbkp_schedule_id' => $schedule->get_id(), 324 'action' => 'hmbkp_add_exclude_rule', 325 'hmbkp_exclude_pathname' => urlencode( $exclude_path ), 326 ), admin_url( 'admin-post.php' ) ), 'hmbkp-add-exclude-rule', 'hmbkp-add-exclude-rule-nonce' ) ); ?>" class="button-secondary"><?php _e( 'Exclude →', 'backupwordpress' ); ?></a> 380 <a href="<?php echo esc_url( wp_nonce_url( 381 add_query_arg( array( 382 'hmbkp_schedule_id' => $schedule->get_id(), 383 'action' => 'hmbkp_add_exclude_rule', 384 'hmbkp_exclude_pathname' => urlencode( $exclude_path ), 385 ), 386 admin_url( 'admin-post.php' ) 387 ), 388 'hmbkp-add-exclude-rule', 389 'hmbkp-add-exclude-rule-nonce' 390 ) ); ?>" class="button-secondary"> 391 <?php esc_html_e( 'Exclude →', 'backupwordpress' ); ?> 392 </a> 327 393 328 394 <?php endif; ?> … … 337 403 338 404 <tr> 339 <td colspan="5"><span class="description"><?php _e( 'This folder is empty', 'backupwordpress' ); ?></span></td> 405 <td colspan="5"> 406 <span class="description"><?php esc_html_e( 'This folder is empty', 'backupwordpress' ); ?></span> 407 </td> 340 408 </tr> 341 409 … … 347 415 348 416 <p class="submit"> 349 <a href="<?php echo esc_url( get_settings_url() ) ?>" class="button-primary"><?php _e( 'Done', 'backupwordpress' ); ?></a> 417 <a href="<?php echo esc_url( get_settings_url() ) ?>" class="button-primary"> 418 <?php esc_html_e( 'Done', 'backupwordpress' ); ?> 419 </a> 350 420 </p> 351 421 -
backupwordpress/trunk/assets/hmbkp.min.js
r1383488 r1466192 1 var BackUpWordPressAdmin=function(a){"use strict";function b(){d=a("select#hmbkp_schedule_recurrence_type"),a.ajaxSetup({cache:!1}),d.length&&(c(d.val()),a(document).on("change","select#hmbkp_schedule_recurrence_type",function(){c(a(this).val())})),a(".notice.is-dismissible").on("click",".notice-dismiss",function(){a.post(ajaxurl,{action:"hmbkp_dismiss_notice"})}),a(document).on("click",".hmbkp-schedule-actions .delete-action",function(a){confirm(hmbkp.delete_schedule)||a.preventDefault()}),a(document).on("click",".hmbkp_manage_backups_row .delete-action",function(a){confirm(hmbkp.delete_backup)||a.preventDefault()}),a(document).on("click",".hmbkp-edit-schedule-excludes-form .delete-action",function(a){confirm(hmbkp.remove_exclude_rule)||a.preventDefault()}),a.post(ajaxurl,{nonce:hmbkp.nonce,action:"hmbkp_cron_test"},function(b){"1"!==b&&a(".wrap > h2").after(b)}),a(document).on("click",".hmbkp-run",function(b){wp.heartbeat.interval("fast"),a(this).closest(".hmbkp-schedule-sentence").addClass("hmbkp-running"),a(".hmbkp-error").removeClass("hmbkp-error");var c=a("[data-hmbkp-schedule-id]").attr("data-hmbkp-schedule-id");a.post(ajaxurl,{hmbkp_run_schedule_nonce:hmbkp.hmbkp_run_schedule_nonce,action:"hmbkp_run_schedule",hmbkp_schedule_id:c}),b.preventDefault()}),a(document).on("heartbeat-send",function(b,c){c.hmbkp_schedule_id=a("[data-hmbkp-schedule-id]").attr("data-hmbkp-schedule-id"),a(".hmbkp-schedule-sentence.hmbkp-running").length?c.hmbkp_is_in_progress=!0:c.hmbkp_client_request="site_size"}),a(document).on("heartbeat-tick",function(b,c){if(0!==c.hmbkp_schedule_status||a(".hmbkp-error").length||location.reload(!0),0!==c.hmbkp_schedule_status&&void 0!==c.hmbkp_schedule_status&&a(".hmbkp-status").replaceWith(c.hmbkp_schedule_status),void 0!==c.hmbkp_site_size&&a("code.calculating").length){a("code.calculating").text(c.hmbkp_site_size);var d=a(".hmbkp-exclude-settings");d.length&&d.replaceWith(c.hmbkp_dir_sizes)}}),a(document).on("click",".hmbkp-thickbox-close",function(a){a.preventDefault(),window.parent.tb_remove()}),a(document).on("click",'[id^="hmbkp-warning-"] .notice-dismiss',function(){a.post(ajaxurl,{action:"hmbkp_dismiss_error"})}),jQuery(document).one("click",".hmbkp_send_error_via_email",function(a){a.preventDefault(),jQuery(this).addClass("hmbkp-ajax-loading").attr("disabled","disabled"),jQuery.post(ajaxurl,{nonce:hmbkp.nonce,action:"hmbkp_email_error",hmbkp_error:data},function(){})})}function c(a){a="undefined"!=typeof a?a:"manually";var b=jQuery(".recurring-setting"),c=jQuery("#schedule-start"),d=jQuery(".twice-js");switch(a){case"manually":b.hide();break;case"hourly":b.hide();break;case"daily":b.hide(),c.show(),d.hide();break;case"twicedaily":b.hide(),c.show(),d.show();break;case"weekly":// fall through 1 var BackUpWordPressAdmin=function(a){"use strict";function b(){d=a("select#hmbkp_schedule_recurrence_type"), 2 // Don't ever cache ajax requests 3 a.ajaxSetup({cache:!1}),d.length&&(c(d.val()),a(document).on("change","select#hmbkp_schedule_recurrence_type",function(){c(a(this).val())})),a(".notice.is-dismissible").on("click",".notice-dismiss",function(){a.post(ajaxurl,{action:"hmbkp_dismiss_notice"})}), 4 // Show delete confirm message for delete schedule 5 a(document).on("click",".hmbkp-schedule-actions .delete-action",function(a){confirm(hmbkp.delete_schedule)||a.preventDefault()}), 6 // Show delete confirm message for delete backup 7 a(document).on("click",".hmbkp_manage_backups_row .delete-action",function(a){confirm(hmbkp.delete_backup)||a.preventDefault()}), 8 // Show delete confirm message for remove exclude rule 9 a(document).on("click",".hmbkp-edit-schedule-excludes-form .delete-action",function(a){confirm(hmbkp.remove_exclude_rule)||a.preventDefault()}), 10 // Test the cron response using ajax 11 a.post(ajaxurl,{nonce:hmbkp.nonce,action:"hmbkp_cron_test"},function(b){"1"!==b&&a(".wrap > h2").after(b)}), 12 // Run a backup 13 a(document).on("click",".hmbkp-run",function(b){wp.heartbeat.interval("fast"),a(this).closest(".hmbkp-schedule-sentence").addClass("hmbkp-running"),a(".hmbkp-error").removeClass("hmbkp-error");var c=a("[data-hmbkp-schedule-id]").attr("data-hmbkp-schedule-id");a.post(ajaxurl,{hmbkp_run_schedule_nonce:hmbkp.hmbkp_run_schedule_nonce,action:"hmbkp_run_schedule",hmbkp_schedule_id:c}),b.preventDefault()}), 14 // Send the schedule id with the heartbeat 15 a(document).on("heartbeat-send",function(b,c){c.hmbkp_schedule_id=a("[data-hmbkp-schedule-id]").attr("data-hmbkp-schedule-id"),a(".hmbkp-schedule-sentence.hmbkp-running").length?c.hmbkp_is_in_progress=!0:c.hmbkp_client_request="site_size"}), 16 // Update schedule status on heartbeat tick 17 a(document).on("heartbeat-tick",function(b,c){if( 18 // If the schedule has finished then reload the page 19 0!==c.hmbkp_schedule_status||a(".hmbkp-error").length||location.reload(!0), 20 // If the schedule is still running then update the schedule status 21 0!==c.hmbkp_schedule_status&&void 0!==c.hmbkp_schedule_status&&a(".hmbkp-status").replaceWith(c.hmbkp_schedule_status),void 0!==c.hmbkp_site_size&&a("code.calculating").length){a("code.calculating").text(c.hmbkp_site_size);var d=a(".hmbkp-exclude-settings");d.length&&d.replaceWith(c.hmbkp_dir_sizes)}}), 22 // Closing ThickBox Modal Window 23 a(document).on("click",".hmbkp-thickbox-close",function(a){a.preventDefault(),window.parent.tb_remove()}),a(document).on("click",'[id^="hmbkp-warning-"] .notice-dismiss',function(){a.post(ajaxurl,{action:"hmbkp_dismiss_error"})}),jQuery(document).one("click",".hmbkp_send_error_via_email",function(a){a.preventDefault(),jQuery(this).addClass("hmbkp-ajax-loading").attr("disabled","disabled"),jQuery.post(ajaxurl,{nonce:hmbkp.nonce,action:"hmbkp_email_error",hmbkp_error:data},function(){})})}function c(a){a="undefined"!=typeof a?a:"manually";var b=jQuery(".recurring-setting"),c=jQuery("#schedule-start"),d=jQuery(".twice-js");switch(a){case"manually":b.hide();break;case"hourly":b.hide();break;case"daily":b.hide(),c.show(),d.hide();break;case"twicedaily":b.hide(),c.show(),d.show();break;case"weekly":// fall through 2 24 case"fortnightly":b.hide(),jQuery("#start-day").show(),c.show(),d.hide();break;case"monthly":b.hide(),c.show(),jQuery("#start-date").show(),d.hide()}}var d;return{init:b}}(jQuery);jQuery(document).ready(BackUpWordPressAdmin.init); -
backupwordpress/trunk/backupwordpress.php
r1405409 r1466192 4 4 Plugin URI: http://bwp.hmn.md/ 5 5 Description: Simple automated backups of your WordPress powered website. Once activated you'll find me under <strong>Tools → Backups</strong>. On multisite, you'll find me under the Network Settings menu. 6 Version: 3.6. 16 Version: 3.6. 7 7 Author: Human Made Limited 8 8 Author URI: http://hmn.md/ -
backupwordpress/trunk/classes/backup/class-backup-engine-database-mysqldump.php
r1405409 r1466192 80 80 81 81 /** 82 * Check whether it's possible to connect to the database with the83 * credentials we have.84 *85 * @return bool Whether the database connection was successful.86 */87 public function check_user_can_connect_to_database_via_cli() {88 89 if ( ! function_exists( 'proc_open' ) || ! function_exists( 'proc_close' ) ) {90 return false;91 }92 93 $args = $this->get_mysql_connection_args();94 $args[] = escapeshellarg( $this->get_name() );95 96 // Quit immediately as we're only interesting in testing the connection97 $args[] = '--execute="quit"';98 99 $process = new Process( 'mysql ' . implode( ' ', $args ) );100 101 try {102 $process->run();103 } catch ( \Exception $e ) {104 $this->error( __CLASS__, $e->getMessage() );105 return false;106 }107 108 if ( ! $process->isSuccessful() ) {109 $this->error( __CLASS__, $process->getErrorOutput() );110 return false;111 }112 113 return true;114 115 }116 117 /**118 82 * Perform the database backup. 119 83 * … … 122 86 public function backup() { 123 87 124 if ( ! $this-> check_user_can_connect_to_database_via_cli() || ! $this->get_mysqldump_executable_path() ) {88 if ( ! $this->get_mysqldump_executable_path() ) { 125 89 return false; 126 90 } -
backupwordpress/trunk/classes/class-plugin.php
r1405409 r1466192 7 7 */ 8 8 final class Plugin { 9 const PLUGIN_VERSION = '3.6. 1';9 const PLUGIN_VERSION = '3.6.'; 10 10 11 11 /** … … 129 129 require_once( HMBKP_PLUGIN_PATH . 'classes/class-notices.php' ); 130 130 131 // Load the admin menu 131 // Load Whitelist HTML submodule and admin required functions. 132 require_once( HMBKP_PLUGIN_PATH . 'whitelist-html/whitelist-html.php' ); 132 133 require_once( HMBKP_PLUGIN_PATH . 'admin/menu.php' ); 133 134 require_once( HMBKP_PLUGIN_PATH . 'admin/actions.php' ); -
backupwordpress/trunk/classes/class-scheduled-backup.php
r1383488 r1466192 649 649 if ( get_option( 'hmbkp_schedule_' . $this->get_id() ) !== $this->options ) { 650 650 update_option( 'hmbkp_schedule_' . $this->get_id(), $this->options ); 651 652 653 651 654 } 652 655 … … 666 669 delete_option( 'hmbkp_schedule_' . $this->get_id() ); 667 670 671 672 673 668 674 // Clear any existing schedules 669 675 $this->unschedule(); -
backupwordpress/trunk/classes/class-schedules.php
r1383488 r1466192 41 41 public function refresh_schedules() { 42 42 43 global $wpdb;43 ; 44 44 45 // Load all schedule options from the database 46 $schedules = $wpdb->get_col( "SELECT option_name from $wpdb->options WHERE option_name LIKE 'hmbkp\_schedule\_%'" ); 45 if ( ! $schedules ) { 46 47 global $wpdb; 48 49 // Load all schedule options from the database. 50 $schedules = $wpdb->get_col( "SELECT option_name from $wpdb->options WHERE option_name LIKE 'hmbkp\_schedule\_%'" ); 51 52 set_transient( 'hmbkp_schedules', $schedules, WEEK_IN_SECONDS ); 53 } 47 54 48 55 // Instantiate each one as a Scheduled_Backup -
backupwordpress/trunk/classes/class-site-size.php
r1368515 r1466192 51 51 if ( 'file' !== $this->type ) { 52 52 53 global $wpdb; 54 $tables = $wpdb->get_results( 'SHOW TABLE STATUS FROM `' . DB_NAME . '`', ARRAY_A ); 55 56 foreach ( $tables as $table ) { 57 $size += (float) $table['Data_length']; 53 $size = (int) get_transient( 'hmbkp_database_size' ); 54 55 if ( ! $size ) { 56 57 global $wpdb; 58 59 $tables = $wpdb->get_results( 'SHOW TABLE STATUS FROM `' . DB_NAME . '`', ARRAY_A ); 60 61 foreach ( $tables as $table ) { 62 $size += (float) $table['Data_length']; 63 } 64 65 set_transient( 'hmbkp_database_size', $size, WEEK_IN_SECONDS ); 58 66 } 59 67 } … … 186 194 public function directory_filesize( \SplFileInfo $file ) { 187 195 196 197 198 199 200 201 202 203 204 188 205 // If we haven't calculated the site size yet then kick it off in a thread 189 206 $directory_sizes = $this->get_cached_filesizes(); … … 196 213 } 197 214 198 // The filepaths are stored in keys so we need to flip for use with preg_grep 215 /* 216 * Ensure we only include files in the current path, the filepaths are stored in keys 217 * so we need to flip for use with preg_grep. 218 */ 199 219 $directory_sizes = array_flip( preg_grep( '(' . wp_normalize_path( $file->getRealPath() ) . ')', array_flip( $directory_sizes ) ) ); 200 220 … … 207 227 } 208 228 209 // Directory size is now just a sum of all files across all sub directories 210 return absint( array_sum( $directory_sizes ) ); 229 $directory_sizes = absint( array_sum( $directory_sizes ) ); 230 231 // For performance reasons we cache the root. 232 if ( $file->getRealPath() === PATH::get_root() && $this->excludes ) { 233 set_transient( 'hmbkp_root_size', $directory_sizes, DAY_IN_SECONDS ); 234 } 235 236 // Directory size is now just a sum of all files across all sub directories. 237 return $directory_sizes; 211 238 212 239 } -
backupwordpress/trunk/languages/backupwordpress.pot
r1405409 r1466192 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: BackUpWordPress 3.6. 1\n"5 "Project-Id-Version: BackUpWordPress 3.6.\n" 6 6 "Report-Msgid-Bugs-To: backupwordpress@hmn.md\n" 7 "POT-Creation-Date: 2016-0 4-26 15:47:53+00:00\n"7 "POT-Creation-Date: 2016-0+00:00\n" 8 8 "MIME-Version: 1.0\n" 9 9 "Content-Type: text/plain; charset=utf-8\n" … … 68 68 msgstr "" 69 69 70 #: admin/actions.php:63 6 admin/actions.php:64270 #: admin/actions.php:63 71 71 msgid "BackUpWordPress has detected a problem." 72 72 msgstr "" 73 73 74 #: admin/actions.php:63 674 #: admin/actions.php:63 75 75 msgid "" 76 76 "%1$s is returning a %2$s response which could mean cron jobs aren't getting " … … 79 79 msgstr "" 80 80 81 #: admin/actions.php:64 281 #: admin/actions.php:64 82 82 msgid "" 83 83 "%1$s is returning a %2$s response which could mean cron jobs aren't getting " … … 91 91 msgstr "" 92 92 93 #: admin/backups-table.php:15 admin/schedule-form-excludes.php:1 1193 #: admin/backups-table.php:15 admin/schedule-form-excludes.php:1 94 94 msgid "Type" 95 95 msgstr "" … … 489 489 msgstr "" 490 490 491 #: admin/schedule-form-excludes.php:1 4492 msgid "" 493 "We automatically detect and ignore common <abbr title=\"Version Control"494 " Systems\">VCS</abbr> foldersand other backup plugin folders."495 msgstr "" 496 497 #: admin/schedule-form-excludes.php:5 0491 #: admin/schedule-form-excludes.php:1 492 msgid "" 493 "We automatically detect and ignore common " 494 "and other backup plugin folders." 495 msgstr "" 496 497 #: admin/schedule-form-excludes.php:5 498 498 msgid "Default rule" 499 499 msgstr "" 500 500 501 #: admin/schedule-form-excludes.php:5 4502 msgid "Defined in wp-config.php"503 msgstr "" 504 505 #: admin/schedule-form-excludes.php:6 1501 #: admin/schedule-form-excludes.php:5 502 msgid "Defined in " 503 msgstr "" 504 505 #: admin/schedule-form-excludes.php:6 506 506 msgid "Stop excluding" 507 507 msgstr "" 508 508 509 #: admin/schedule-form-excludes.php: 75509 #: admin/schedule-form-excludes.php: 510 510 msgid "Your Site" 511 511 msgstr "" 512 512 513 #: admin/schedule-form-excludes.php: 77513 #: admin/schedule-form-excludes.php:7 514 514 msgid "" 515 515 "Here's a directory listing of all files on your site, you can browse " … … 518 518 msgstr "" 519 519 520 #: admin/schedule-form-excludes.php:1 08520 #: admin/schedule-form-excludes.php:1 521 521 msgid "Name" 522 522 msgstr "" 523 523 524 #: admin/schedule-form-excludes.php:1 09524 #: admin/schedule-form-excludes.php:1 525 525 msgid "Included Size" 526 526 msgstr "" 527 527 528 #: admin/schedule-form-excludes.php:1 10528 #: admin/schedule-form-excludes.php:1 529 529 msgid "Permissions" 530 530 msgstr "" 531 531 532 #: admin/schedule-form-excludes.php:1 12532 #: admin/schedule-form-excludes.php:1 533 533 msgid "Status" 534 534 msgstr "" 535 535 536 #: admin/schedule-form-excludes.php:162 admin/schedule-form-excludes.php:263 537 msgid "%s of %s" 538 msgstr "" 539 540 #: admin/schedule-form-excludes.php:163 536 #: admin/schedule-form-excludes.php:188 admin/schedule-form-excludes.php:312 537 #. translators: 1: Excluded size 2: Overall site size 538 msgid "%1$s of %2$s" 539 msgstr "" 540 541 #: admin/schedule-form-excludes.php:195 541 542 msgid "Refresh" 542 543 msgstr "" 543 544 544 #: admin/schedule-form-excludes.php: 177 admin/schedule-form-excludes.php:294545 #: admin/schedule-form-excludes.php: 545 546 msgid "Symlink" 546 547 msgstr "" 547 548 548 #: admin/schedule-form-excludes.php: 179 admin/schedule-form-excludes.php:296549 #: admin/schedule-form-excludes.php: 549 550 msgid "Folder" 550 551 msgstr "" 551 552 552 #: admin/schedule-form-excludes.php: 298553 #: admin/schedule-form-excludes.php: 553 554 msgid "File" 554 555 msgstr "" 555 556 556 #: admin/schedule-form-excludes.php:3 07557 #: admin/schedule-form-excludes.php:3 557 558 msgid "Unreadable files won't be backed up." 558 559 msgstr "" 559 560 560 #: admin/schedule-form-excludes.php:3 07561 #: admin/schedule-form-excludes.php:3 561 562 msgid "Unreadable" 562 563 msgstr "" 563 564 564 #: admin/schedule-form-excludes.php:3 11565 #: admin/schedule-form-excludes.php:3 565 566 msgid "Excluded" 566 567 msgstr "" 567 568 568 #: admin/schedule-form-excludes.php:3 26569 #: admin/schedule-form-excludes.php:3 569 570 msgid "Exclude →" 570 571 msgstr "" 571 572 572 #: admin/schedule-form-excludes.php: 339573 #: admin/schedule-form-excludes.php: 573 574 msgid "This folder is empty" 574 575 msgstr "" 575 576 576 #: admin/schedule-form-excludes.php: 349admin/schedule-form.php:204577 #: admin/schedule-form-excludes.php: admin/schedule-form.php:204 577 578 #: admin/schedule-settings.php:85 578 579 msgid "Done" … … 870 871 msgstr "" 871 872 872 #: classes/class-plugin.php:24 0873 #: classes/class-plugin.php:24 873 874 msgid "Update" 874 875 msgstr "" 875 876 876 #: classes/class-plugin.php:24 1877 #: classes/class-plugin.php:24 877 878 msgid "Cancel" 878 879 msgstr "" 879 880 880 #: classes/class-plugin.php:24 2881 #: classes/class-plugin.php:24 881 882 msgid "" 882 883 "Are you sure you want to delete this schedule? All of its backups will also " … … 884 885 msgstr "" 885 886 886 #: classes/class-plugin.php:24 2 classes/class-plugin.php:243887 #: classes/class-plugin.php:24 4 classes/class-plugin.php:245887 #: classes/class-plugin.php:24 888 #: classes/class-plugin.php:24 888 889 msgid "'Cancel' to go back, 'OK' to delete." 889 890 msgstr "" 890 891 891 #: classes/class-plugin.php:24 3892 #: classes/class-plugin.php:24 892 893 msgid "Are you sure you want to delete this backup?" 893 894 msgstr "" 894 895 895 #: classes/class-plugin.php:24 4896 #: classes/class-plugin.php:24 896 897 msgid "Are you sure you want to remove this exclude rule?" 897 898 msgstr "" 898 899 899 #: classes/class-plugin.php:24 5900 #: classes/class-plugin.php:24 900 901 msgid "" 901 902 "Reducing the number of backups that are stored on this server will cause " … … 904 905 msgstr "" 905 906 906 #: classes/class-plugin.php:44 4907 #: classes/class-plugin.php:44 907 908 #. translators: %1$s and %2$s expand to anchor tags linking to the new 908 909 #. extensions page. … … 912 913 msgstr "" 913 914 914 #: classes/class-plugin.php:45 4915 #: classes/class-plugin.php:45 915 916 msgid "Dismiss this notice." 916 917 msgstr "" -
backupwordpress/trunk/readme.txt
r1410323 r1466192 1 1 === BackUpWordPress === 2 Contributors: humanmade, willmot, pauldewouters, joehoyle, mattheu, tcrsavage, cuvelier2 Contributors: humanmade, willmot, pauldewouters, joehoyle, mattheu, tcrsavage, cuvelier 3 3 Tags: back up, backup, backups, database, zip, db, files, archive, wp-cli, humanmade 4 4 Requires at least: 3.9 5 Tested up to: 4. 4.26 Stable tag: 3.6. 15 Tested up to: 4. 6 Stable tag: 3.6. 7 7 8 8 Simple automated backups of your WordPress-powered website. … … 158 158 159 159 == Changelog == 160 161 162 163 164 165 166 167 168 169 160 170 161 171 ### 3.6.0 / 2016-03-31 -
backupwordpress/trunk/vendor/composer/autoload_classmap.php
r1405409 r1466192 7 7 8 8 return array( 9 'Ifsnop\\Mysqldump\\CompressBzip2' => $vendorDir . '/ifsnop/mysqldump-php/src/Ifsnop/Mysqldump/Mysqldump.php',10 'Ifsnop\\Mysqldump\\CompressGzip' => $vendorDir . '/ifsnop/mysqldump-php/src/Ifsnop/Mysqldump/Mysqldump.php',11 'Ifsnop\\Mysqldump\\CompressManagerFactory' => $vendorDir . '/ifsnop/mysqldump-php/src/Ifsnop/Mysqldump/Mysqldump.php',12 'Ifsnop\\Mysqldump\\CompressMethod' => $vendorDir . '/ifsnop/mysqldump-php/src/Ifsnop/Mysqldump/Mysqldump.php',13 'Ifsnop\\Mysqldump\\CompressNone' => $vendorDir . '/ifsnop/mysqldump-php/src/Ifsnop/Mysqldump/Mysqldump.php',14 'Ifsnop\\Mysqldump\\Mysqldump' => $vendorDir . '/ifsnop/mysqldump-php/src/Ifsnop/Mysqldump/Mysqldump.php',15 'Ifsnop\\Mysqldump\\TypeAdapter' => $vendorDir . '/ifsnop/mysqldump-php/src/Ifsnop/Mysqldump/Mysqldump.php',16 'Ifsnop\\Mysqldump\\TypeAdapterDblib' => $vendorDir . '/ifsnop/mysqldump-php/src/Ifsnop/Mysqldump/Mysqldump.php',17 'Ifsnop\\Mysqldump\\TypeAdapterFactory' => $vendorDir . '/ifsnop/mysqldump-php/src/Ifsnop/Mysqldump/Mysqldump.php',18 'Ifsnop\\Mysqldump\\TypeAdapterMysql' => $vendorDir . '/ifsnop/mysqldump-php/src/Ifsnop/Mysqldump/Mysqldump.php',19 'Ifsnop\\Mysqldump\\TypeAdapterPgsql' => $vendorDir . '/ifsnop/mysqldump-php/src/Ifsnop/Mysqldump/Mysqldump.php',20 'Ifsnop\\Mysqldump\\TypeAdapterSqlite' => $vendorDir . '/ifsnop/mysqldump-php/src/Ifsnop/Mysqldump/Mysqldump.php',21 'Symfony\\Component\\Finder\\Adapter\\AbstractAdapter' => $vendorDir . '/symfony/finder/Adapter/AbstractAdapter.php',22 'Symfony\\Component\\Finder\\Adapter\\AbstractFindAdapter' => $vendorDir . '/symfony/finder/Adapter/AbstractFindAdapter.php',23 'Symfony\\Component\\Finder\\Adapter\\AdapterInterface' => $vendorDir . '/symfony/finder/Adapter/AdapterInterface.php',24 'Symfony\\Component\\Finder\\Adapter\\BsdFindAdapter' => $vendorDir . '/symfony/finder/Adapter/BsdFindAdapter.php',25 'Symfony\\Component\\Finder\\Adapter\\GnuFindAdapter' => $vendorDir . '/symfony/finder/Adapter/GnuFindAdapter.php',26 'Symfony\\Component\\Finder\\Adapter\\PhpAdapter' => $vendorDir . '/symfony/finder/Adapter/PhpAdapter.php',27 'Symfony\\Component\\Finder\\Comparator\\Comparator' => $vendorDir . '/symfony/finder/Comparator/Comparator.php',28 'Symfony\\Component\\Finder\\Comparator\\DateComparator' => $vendorDir . '/symfony/finder/Comparator/DateComparator.php',29 'Symfony\\Component\\Finder\\Comparator\\NumberComparator' => $vendorDir . '/symfony/finder/Comparator/NumberComparator.php',30 'Symfony\\Component\\Finder\\Exception\\AccessDeniedException' => $vendorDir . '/symfony/finder/Exception/AccessDeniedException.php',31 'Symfony\\Component\\Finder\\Exception\\AdapterFailureException' => $vendorDir . '/symfony/finder/Exception/AdapterFailureException.php',32 'Symfony\\Component\\Finder\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/finder/Exception/ExceptionInterface.php',33 'Symfony\\Component\\Finder\\Exception\\OperationNotPermitedException' => $vendorDir . '/symfony/finder/Exception/OperationNotPermitedException.php',34 'Symfony\\Component\\Finder\\Exception\\ShellCommandFailureException' => $vendorDir . '/symfony/finder/Exception/ShellCommandFailureException.php',35 'Symfony\\Component\\Finder\\Expression\\Expression' => $vendorDir . '/symfony/finder/Expression/Expression.php',36 'Symfony\\Component\\Finder\\Expression\\Glob' => $vendorDir . '/symfony/finder/Expression/Glob.php',37 'Symfony\\Component\\Finder\\Expression\\Regex' => $vendorDir . '/symfony/finder/Expression/Regex.php',38 'Symfony\\Component\\Finder\\Expression\\ValueInterface' => $vendorDir . '/symfony/finder/Expression/ValueInterface.php',39 'Symfony\\Component\\Finder\\Finder' => $vendorDir . '/symfony/finder/Finder.php',40 'Symfony\\Component\\Finder\\Glob' => $vendorDir . '/symfony/finder/Glob.php',41 'Symfony\\Component\\Finder\\Iterator\\CustomFilterIterator' => $vendorDir . '/symfony/finder/Iterator/CustomFilterIterator.php',42 'Symfony\\Component\\Finder\\Iterator\\DateRangeFilterIterator' => $vendorDir . '/symfony/finder/Iterator/DateRangeFilterIterator.php',43 'Symfony\\Component\\Finder\\Iterator\\DepthRangeFilterIterator' => $vendorDir . '/symfony/finder/Iterator/DepthRangeFilterIterator.php',44 'Symfony\\Component\\Finder\\Iterator\\ExcludeDirectoryFilterIterator' => $vendorDir . '/symfony/finder/Iterator/ExcludeDirectoryFilterIterator.php',45 'Symfony\\Component\\Finder\\Iterator\\FilePathsIterator' => $vendorDir . '/symfony/finder/Iterator/FilePathsIterator.php',46 'Symfony\\Component\\Finder\\Iterator\\FileTypeFilterIterator' => $vendorDir . '/symfony/finder/Iterator/FileTypeFilterIterator.php',47 'Symfony\\Component\\Finder\\Iterator\\FilecontentFilterIterator' => $vendorDir . '/symfony/finder/Iterator/FilecontentFilterIterator.php',48 'Symfony\\Component\\Finder\\Iterator\\FilenameFilterIterator' => $vendorDir . '/symfony/finder/Iterator/FilenameFilterIterator.php',49 'Symfony\\Component\\Finder\\Iterator\\FilterIterator' => $vendorDir . '/symfony/finder/Iterator/FilterIterator.php',50 'Symfony\\Component\\Finder\\Iterator\\MultiplePcreFilterIterator' => $vendorDir . '/symfony/finder/Iterator/MultiplePcreFilterIterator.php',51 'Symfony\\Component\\Finder\\Iterator\\PathFilterIterator' => $vendorDir . '/symfony/finder/Iterator/PathFilterIterator.php',52 'Symfony\\Component\\Finder\\Iterator\\RecursiveDirectoryIterator' => $vendorDir . '/symfony/finder/Iterator/RecursiveDirectoryIterator.php',53 'Symfony\\Component\\Finder\\Iterator\\SizeRangeFilterIterator' => $vendorDir . '/symfony/finder/Iterator/SizeRangeFilterIterator.php',54 'Symfony\\Component\\Finder\\Iterator\\SortableIterator' => $vendorDir . '/symfony/finder/Iterator/SortableIterator.php',55 'Symfony\\Component\\Finder\\Shell\\Command' => $vendorDir . '/symfony/finder/Shell/Command.php',56 'Symfony\\Component\\Finder\\Shell\\Shell' => $vendorDir . '/symfony/finder/Shell/Shell.php',57 'Symfony\\Component\\Finder\\SplFileInfo' => $vendorDir . '/symfony/finder/SplFileInfo.php',58 'Symfony\\Component\\Process\\Exception\\ExceptionInterface' => $vendorDir . '/symfony/process/Exception/ExceptionInterface.php',59 'Symfony\\Component\\Process\\Exception\\InvalidArgumentException' => $vendorDir . '/symfony/process/Exception/InvalidArgumentException.php',60 'Symfony\\Component\\Process\\Exception\\LogicException' => $vendorDir . '/symfony/process/Exception/LogicException.php',61 'Symfony\\Component\\Process\\Exception\\ProcessFailedException' => $vendorDir . '/symfony/process/Exception/ProcessFailedException.php',62 'Symfony\\Component\\Process\\Exception\\ProcessTimedOutException' => $vendorDir . '/symfony/process/Exception/ProcessTimedOutException.php',63 'Symfony\\Component\\Process\\Exception\\RuntimeException' => $vendorDir . '/symfony/process/Exception/RuntimeException.php',64 'Symfony\\Component\\Process\\ExecutableFinder' => $vendorDir . '/symfony/process/ExecutableFinder.php',65 'Symfony\\Component\\Process\\PhpExecutableFinder' => $vendorDir . '/symfony/process/PhpExecutableFinder.php',66 'Symfony\\Component\\Process\\PhpProcess' => $vendorDir . '/symfony/process/PhpProcess.php',67 'Symfony\\Component\\Process\\Pipes\\AbstractPipes' => $vendorDir . '/symfony/process/Pipes/AbstractPipes.php',68 'Symfony\\Component\\Process\\Pipes\\PipesInterface' => $vendorDir . '/symfony/process/Pipes/PipesInterface.php',69 'Symfony\\Component\\Process\\Pipes\\UnixPipes' => $vendorDir . '/symfony/process/Pipes/UnixPipes.php',70 'Symfony\\Component\\Process\\Pipes\\WindowsPipes' => $vendorDir . '/symfony/process/Pipes/WindowsPipes.php',71 'Symfony\\Component\\Process\\Process' => $vendorDir . '/symfony/process/Process.php',72 'Symfony\\Component\\Process\\ProcessBuilder' => $vendorDir . '/symfony/process/ProcessBuilder.php',73 'Symfony\\Component\\Process\\ProcessUtils' => $vendorDir . '/symfony/process/ProcessUtils.php',74 9 ); -
backupwordpress/trunk/vendor/composer/installed.json
r1383488 r1466192 56 56 { 57 57 "name": "symfony/finder", 58 "version": "v2.8. 4",59 "version_normalized": "2.8. 4.0",58 "version": "v2.8.", 59 "version_normalized": "2.8..0", 60 60 "source": { 61 61 "type": "git", 62 62 "url": "https://github.com/symfony/finder.git", 63 "reference": " ca24cf2cd4e3826f571e0067e535758e73807aa1"63 "reference": "" 64 64 }, 65 65 "dist": { 66 66 "type": "zip", 67 "url": "https://api.github.com/repos/symfony/finder/zipball/ ca24cf2cd4e3826f571e0067e535758e73807aa1",68 "reference": " ca24cf2cd4e3826f571e0067e535758e73807aa1",67 "url": "https://api.github.com/repos/symfony/finder/zipball/", 68 "reference": "", 69 69 "shasum": "" 70 70 }, … … 72 72 "php": ">=5.3.9" 73 73 }, 74 "time": "2016-0 3-10 10:53:53",74 "time": "2016-0", 75 75 "type": "library", 76 76 "extra": { … … 107 107 { 108 108 "name": "symfony/process", 109 "version": "v2.8. 4",110 "version_normalized": "2.8. 4.0",109 "version": "v2.8.", 110 "version_normalized": "2.8..0", 111 111 "source": { 112 112 "type": "git", 113 113 "url": "https://github.com/symfony/process.git", 114 "reference": " fb467471952ef5cf8497c029980e556b47545333"114 "reference": "" 115 115 }, 116 116 "dist": { 117 117 "type": "zip", 118 "url": "https://api.github.com/repos/symfony/process/zipball/ fb467471952ef5cf8497c029980e556b47545333",119 "reference": " fb467471952ef5cf8497c029980e556b47545333",118 "url": "https://api.github.com/repos/symfony/process/zipball/", 119 "reference": "", 120 120 "shasum": "" 121 121 }, … … 123 123 "php": ">=5.3.9" 124 124 }, 125 "time": "2016-0 3-23 13:11:46",125 "time": "2016-0", 126 126 "type": "library", 127 127 "extra": { -
backupwordpress/trunk/vendor/symfony/finder/Expression/Expression.php
r1332238 r1466192 126 126 127 127 /** 128 129 128 130 * @throws \LogicException 129 *130 * @return Glob131 131 */ 132 132 public function getGlob() -
backupwordpress/trunk/vendor/symfony/finder/Finder.php
r1332238 r1466192 134 134 * @param string $name 135 135 * 136 137 136 138 * @throws \InvalidArgumentException 137 *138 * @return Finder The current Finder instance139 139 * 140 140 * @deprecated since 2.8, to be removed in 3.0. … … 193 193 * Restricts the matching to directories only. 194 194 * 195 * @return Finder The current Finder instance195 * @return Finder The current Finder instance 196 196 */ 197 197 public function directories() … … 205 205 * Restricts the matching to files only. 206 206 * 207 * @return Finder The current Finder instance207 * @return Finder The current Finder instance 208 208 */ 209 209 public function files() … … 224 224 * @param int $level The depth level expression 225 225 * 226 * @return Finder The current Finder instance226 * @return Finder The current Finder instance 227 227 * 228 228 * @see DepthRangeFilterIterator … … 248 248 * @param string $date A date range string 249 249 * 250 * @return Finder The current Finder instance250 * @return Finder The current Finder instance 251 251 * 252 252 * @see strtotime … … 272 272 * @param string $pattern A pattern (a regexp, a glob, or a string) 273 273 * 274 * @return Finder The current Finder instance274 * @return Finder The current Finder instance 275 275 * 276 276 * @see FilenameFilterIterator … … 288 288 * @param string $pattern A pattern (a regexp, a glob, or a string) 289 289 * 290 * @return Finder The current Finder instance290 * @return Finder The current Finder instance 291 291 * 292 292 * @see FilenameFilterIterator … … 309 309 * @param string $pattern A pattern (string or regexp) 310 310 * 311 * @return Finder The current Finder instance311 * @return Finder The current Finder instance 312 312 * 313 313 * @see FilecontentFilterIterator … … 330 330 * @param string $pattern A pattern (string or regexp) 331 331 * 332 * @return Finder The current Finder instance332 * @return Finder The current Finder instance 333 333 * 334 334 * @see FilecontentFilterIterator … … 353 353 * @param string $pattern A pattern (a regexp or a string) 354 354 * 355 * @return Finder The current Finder instance355 * @return Finder The current Finder instance 356 356 * 357 357 * @see FilenameFilterIterator … … 376 376 * @param string $pattern A pattern (a regexp or a string) 377 377 * 378 * @return Finder The current Finder instance378 * @return Finder The current Finder instance 379 379 * 380 380 * @see FilenameFilterIterator … … 396 396 * @param string $size A size range string 397 397 * 398 * @return Finder The current Finder instance398 * @return Finder The current Finder instance 399 399 * 400 400 * @see SizeRangeFilterIterator … … 413 413 * @param string|array $dirs A directory path or an array of directories 414 414 * 415 * @return Finder The current Finder instance415 * @return Finder The current Finder instance 416 416 * 417 417 * @see ExcludeDirectoryFilterIterator … … 429 429 * @param bool $ignoreDotFiles Whether to exclude "hidden" files or not 430 430 * 431 * @return Finder The current Finder instance431 * @return Finder The current Finder instance 432 432 * 433 433 * @see ExcludeDirectoryFilterIterator … … 449 449 * @param bool $ignoreVCS Whether to exclude VCS files or not 450 450 * 451 * @return Finder The current Finder instance451 * @return Finder The current Finder instance 452 452 * 453 453 * @see ExcludeDirectoryFilterIterator … … 489 489 * @param \Closure $closure An anonymous function 490 490 * 491 * @return Finder The current Finder instance491 * @return Finder The current Finder instance 492 492 * 493 493 * @see SortableIterator … … 505 505 * This can be slow as all the matching files and directories must be retrieved for comparison. 506 506 * 507 * @return Finder The current Finder instance507 * @return Finder The current Finder instance 508 508 * 509 509 * @see SortableIterator … … 521 521 * This can be slow as all the matching files and directories must be retrieved for comparison. 522 522 * 523 * @return Finder The current Finder instance523 * @return Finder The current Finder instance 524 524 * 525 525 * @see SortableIterator … … 539 539 * This can be slow as all the matching files and directories must be retrieved for comparison. 540 540 * 541 * @return Finder The current Finder instance541 * @return Finder The current Finder instance 542 542 * 543 543 * @see SortableIterator … … 559 559 * This can be slow as all the matching files and directories must be retrieved for comparison. 560 560 * 561 * @return Finder The current Finder instance561 * @return Finder The current Finder instance 562 562 * 563 563 * @see SortableIterator … … 577 577 * This can be slow as all the matching files and directories must be retrieved for comparison. 578 578 * 579 * @return Finder The current Finder instance579 * @return Finder The current Finder instance 580 580 * 581 581 * @see SortableIterator … … 596 596 * @param \Closure $closure An anonymous function 597 597 * 598 * @return Finder The current Finder instance598 * @return Finder The current Finder instance 599 599 * 600 600 * @see CustomFilterIterator … … 610 610 * Forces the following of symlinks. 611 611 * 612 * @return Finder The current Finder instance612 * @return Finder The current Finder instance 613 613 */ 614 614 public function followLinks() … … 626 626 * @param bool $ignore 627 627 * 628 * @return Finder The current Finder instance628 * @return Finder The current Finder instance 629 629 */ 630 630 public function ignoreUnreadableDirs($ignore = true) … … 640 640 * @param string|array $dirs A directory path or an array of directories 641 641 * 642 * @return Finder The current Finder instance642 * @return Finder The current Finder instance 643 643 * 644 644 * @throws \InvalidArgumentException if one of the directories does not exist … … 668 668 * This method implements the IteratorAggregate interface. 669 669 * 670 * @return \Iterator An iterator670 * @return \Iterator An iterator 671 671 * 672 672 * @throws \LogicException if the in() method has not been called … … 701 701 * @param mixed $iterator 702 702 * 703 * @return Finder The finder703 * @return Finder The finder 704 704 * 705 705 * @throws \InvalidArgumentException When the given argument is not iterable. -
backupwordpress/trunk/vendor/symfony/finder/Iterator/PathFilterIterator.php
r1332238 r1466192 46 46 * Use only / as directory separator (on Windows also). 47 47 * 48 * @param string $str Pattern: regexp or dirname .48 * @param string $str Pattern: regexp or dirname 49 49 * 50 50 * @return string regexp corresponding to a given string or regexp -
backupwordpress/trunk/vendor/symfony/process/Pipes/AbstractPipes.php
r1383488 r1466192 23 23 24 24 /** @var string */ 25 pr otected$inputBuffer = '';25 pr $inputBuffer = ''; 26 26 /** @var resource|null */ 27 protected $input; 28 27 private $input; 29 28 /** @var bool */ 30 29 private $blocked = true; … … 92 91 return; 93 92 } 94 95 $e = array(); 96 $r = null !== $this->input ? array($this->input) : $e; 93 $input = $this->input; 94 $r = $e = array(); 97 95 $w = array($this->pipes[0]); 98 96 … … 111 109 } 112 110 113 foreach ($r as$input) {111 $input) { 114 112 for (;;) { 115 113 $data = fread($input, self::CHUNK_SIZE); … … 125 123 } 126 124 } 127 if ( !isset($data[0]) &&feof($input)) {125 if (feof($input)) { 128 126 // no more data to read on input resource 129 127 // use an empty buffer in the next reads -
backupwordpress/trunk/vendor/symfony/process/Pipes/PipesInterface.php
r1368515 r1466192 40 40 * Reads data in file handles and pipes. 41 41 * 42 * @param bool $blocking Whether to use blocking calls or not .43 * @param bool $close Whether to close pipes if they've reached EOF .42 * @param bool $blocking Whether to use blocking calls or not 43 * @param bool $close Whether to close pipes if they've reached EOF 44 44 * 45 * @return string[] An array of read data indexed by their fd .45 * @return string[] An array of read data indexed by their fd 46 46 */ 47 47 public function readAndWrite($blocking, $close = false); -
backupwordpress/trunk/vendor/symfony/process/Pipes/WindowsPipes.php
r1383488 r1466192 48 48 // 49 49 // @see https://bugs.php.net/bug.php?id=51800 50 $ this->files = array(51 Process::STDOUT => tempnam(sys_get_temp_dir(), 'out_sf_proc'),52 Process::STDERR => tempnam(sys_get_temp_dir(), 'err_sf_proc'),50 $es = array( 51 Process::STDOUT => , 52 Process::STDERR => , 53 53 ); 54 foreach ($this->files as $offset => $file) { 55 if (false === $file || false === $this->fileHandles[$offset] = @fopen($file, 'rb')) { 56 throw new RuntimeException('A temporary file could not be opened to write the process output to, verify that your TEMP environment variable is writable'); 54 $tmpDir = sys_get_temp_dir(); 55 $error = 'unknown reason'; 56 set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); 57 for ($i = 0;; ++$i) { 58 foreach ($pipes as $pipe => $name) { 59 $file = sprintf('%s\\sf_proc_%02X.%s', $tmpDir, $i, $name); 60 if (file_exists($file) && !unlink($file)) { 61 continue 2; 62 } 63 $h = fopen($file, 'xb'); 64 if (!$h && false === strpos($error, 'File exists')) { 65 restore_error_handler(); 66 throw new RuntimeException(sprintf('A temporary file could not be opened to write the process output: %s', $error)); 67 } 68 if (!$h || !$this->fileHandles[$pipe] = fopen($file, 'rb')) { 69 continue 2; 70 } 71 if (isset($this->files[$pipe])) { 72 unlink($this->files[$pipe]); 73 } 74 $this->files[$pipe] = $file; 57 75 } 58 } 76 break; 77 } 78 restore_error_handler(); 59 79 } 60 80 -
backupwordpress/trunk/vendor/symfony/process/Process.php
r1383488 r1466192 159 159 } 160 160 161 $this-> input = $input;161 $this->; 162 162 $this->setTimeout($timeout); 163 163 $this->useFileHandles = '\\' === DIRECTORY_SEPARATOR; … … 478 478 * output, this one returns the new output since the last call. 479 479 * 480 481 480 482 * @throws LogicException in case the output has been disabled 481 483 * @throws LogicException In case the process is not started 482 *483 * @return string The process output since the last call484 484 */ 485 485 public function getIncrementalOutput() … … 537 537 * call. 538 538 * 539 540 539 541 * @throws LogicException in case the output has been disabled 540 542 * @throws LogicException In case the process is not started 541 *542 * @return string The process error output since the last call543 543 */ 544 544 public function getIncrementalErrorOutput() … … 594 594 * and might not be relevant for other operating systems. 595 595 * 596 * @return null|string A string representation for the exit status code, null if the Process is not terminated .596 * @return null|string A string representation for the exit status code, null if the Process is not terminated 597 597 * 598 598 * @see http://tldp.org/LDP/abs/html/exitcodes.html … … 882 882 * @param int|float|null $timeout The timeout in seconds 883 883 * 884 * @return self The current Process instance .884 * @return self The current Process instance 885 885 * 886 886 * @throws LogicException if the output is disabled … … 1088 1088 } 1089 1089 1090 $this->input = ProcessUtils::validateInput( sprintf('%s::%s', __CLASS__, __FUNCTION__), $input);1090 $this->input = ProcessUtils::validateInput(, $input); 1091 1091 1092 1092 return $this; … … 1266 1266 * Updates the status of the process, reads pipes. 1267 1267 * 1268 * @param bool $blocking Whether to use a blocking read call .1268 * @param bool $blocking Whether to use a blocking read call 1269 1269 */ 1270 1270 protected function updateStatus($blocking) … … 1352 1352 * Reads pipes, executes callback. 1353 1353 * 1354 * @param bool $blocking Whether to use blocking calls or not .1355 * @param bool $close Whether to close file handles or not .1354 * @param bool $blocking Whether to use blocking calls or not 1355 * @param bool $close Whether to close file handles or not 1356 1356 */ 1357 1357 private function readPipes($blocking, $close) … … 1479 1479 * Ensures the process is running or terminated, throws a LogicException if the process has a not started. 1480 1480 * 1481 * @param string $functionName The function name that was called .1481 * @param string $functionName The function name that was called 1482 1482 * 1483 1483 * @throws LogicException If the process has not run. … … 1493 1493 * Ensures the process is terminated, throws a LogicException if the process has a status different than `terminated`. 1494 1494 * 1495 * @param string $functionName The function name that was called .1495 * @param string $functionName The function name that was called 1496 1496 * 1497 1497 * @throws LogicException If the process is not yet terminated. -
backupwordpress/trunk/vendor/symfony/process/ProcessBuilder.php
r1368515 r1466192 178 178 public function setInput($input) 179 179 { 180 $this->input = ProcessUtils::validateInput( sprintf('%s::%s', __CLASS__, __FUNCTION__), $input);180 $this->input = ProcessUtils::validateInput(, $input); 181 181 182 182 return $this; -
backupwordpress/trunk/vendor/symfony/process/ProcessUtils.php
r1368515 r1466192 81 81 * @param mixed $input The input to validate 82 82 * 83 * @return stringThe validated input83 * @return The validated input 84 84 * 85 85 * @throws InvalidArgumentException In case the input is not valid … … 91 91 if (null !== $input) { 92 92 if (is_resource($input)) { 93 94 95 93 96 return $input; 94 97 } -
backupwordpress/trunk/vendor/symfony/process/Tests/ProcessTest.php
r1383488 r1466192 55 55 public function testThatProcessDoesNotThrowWarningDuringRun() 56 56 { 57 58 59 57 60 @trigger_error('Test Error', E_USER_NOTICE); 58 61 $process = $this->getProcess(self::$phpBin." -r 'sleep(3)'"); … … 208 211 $this->assertEquals($expectedLength, strlen($p->getOutput())); 209 212 $this->assertEquals($expectedLength, strlen($p->getErrorOutput())); 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 210 231 } 211 232 … … 1163 1184 * @dataProvider provideVariousIncrementals 1164 1185 */ 1165 public function testIncrementalOutputDoesNotRequireAnotherCall($stream, $method) { 1166 $process = new Process(self::$phpBin.' -r '.escapeshellarg('$n = 0; while ($n < 3) { file_put_contents(\''.$stream.'\', $n, 1); $n++; usleep(1000); }'), null, null, null, null); 1186 public function testIncrementalOutputDoesNotRequireAnotherCall($stream, $method) 1187 { 1188 $process = $this->getProcess(self::$phpBin.' -r '.escapeshellarg('$n = 0; while ($n < 3) { file_put_contents(\''.$stream.'\', $n, 1); $n++; usleep(1000); }'), null, null, null, null); 1167 1189 $process->start(); 1168 1190 $result = ''; … … 1178 1200 } 1179 1201 1180 public function provideVariousIncrementals() { 1202 public function provideVariousIncrementals() 1203 { 1181 1204 return array( 1182 1205 array('php://stdout', 'getIncrementalOutput'), 1183 1206 array('php://stderr', 'getIncrementalErrorOutput'), 1184 1207 ); 1185 }1186 1187 /**1188 * provides default method names for simple getter/setter.1189 */1190 public function methodProvider()1191 {1192 $defaults = array(1193 array('CommandLine'),1194 array('Timeout'),1195 array('WorkingDirectory'),1196 array('Env'),1197 array('Stdin'),1198 array('Input'),1199 array('Options'),1200 );1201 1202 return $defaults;1203 1208 } 1204 1209 … … 1225 1230 $this->assertSame('This PHP has been compiled with --enable-sigchild. You must use setEnhanceSigchildCompatibility() to use this method.', $e->getMessage()); 1226 1231 if ($enhance) { 1227 $process->setEnhanceSig ChildCompatibility(true);1232 $process->setEnhanceSighildCompatibility(true); 1228 1233 } else { 1229 1234 self::$notEnhancedSigchild = true;
Note: See TracChangeset
for help on using the changeset viewer.