Plugin Directory

Changeset 1466192

Timestamp:
08/02/2016 02:01:46 PM (8 years ago)
Author:
pauldewouters
Message:

Version 3.6.2

Location:
backupwordpress/trunk
Files:
2 added
23 edited

Legend:

Unmodified
Added
Removed
  • backupwordpress/trunk/admin/actions.php

    r1383488 r1466192  
    412412
    413413    $schedule->save();
     414
    414415
    415416    wp_safe_redirect( wp_get_referer(), '303' );
     
    442443
    443444    $schedule->save();
     445
    444446
    445447    wp_safe_redirect( wp_get_referer(), '303' );
  • backupwordpress/trunk/admin/schedule-form-excludes.php

    r1383488 r1466192  
    33namespace HM\BackUpWordPress;
    44
    5 $excludes = $schedule->get_excludes();
     5$excludes = $schedule->get_excludes();
    66$user_excludes = $excludes->get_user_excludes(); ?>
    77
     
    99
    1010    <h3>
    11         <?php _e( 'Currently Excluded', 'backupwordpress' ); ?>
     11        <?php _e( 'Currently Excluded', 'backupwordpress' ); ?>
    1212    </h3>
    1313
    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>
    1517
    1618    <table class="widefat">
     
    4648                    <td>
    4749
    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' ); ?>
    5156
    5257                        <?php elseif ( defined( 'HMBKP_EXCLUDE' ) && false !== strpos( HMBKP_EXCLUDE, $exclude ) ) : ?>
    5358
    54                             <?php _e( 'Defined in wp-config.php', 'backupwordpress' ); ?>
     59                            <?php ' ); ?>
    5560
    5661                        <?php else : ?>
     
    5964                                'hmbkp_remove_exclude' => $exclude,
    6065                                '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>
    6269
    6370                        <?php endif; ?>
     
    7380    </table>
    7481
    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>
    7889
    7990    <?php
    8091
    81     // The directory to display
     92    // The directory to display
    8293    $directory = Path::get_root();
    8394
    84     if ( isset( $_GET['hmbkp_directory_browse'] ) ) :
     95    if ( isset( $_GET['hmbkp_directory_browse'] ) )
    8596
    8697        $untrusted_directory = urldecode( $_GET['hmbkp_directory_browse'] );
    8798
    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        ) {
    90104            $directory = $untrusted_directory;
    91         endif;
    92     endif;
     105       
     106   
    93107
    94108    $exclude_string = implode( '|', $excludes->get_excludes_for_regex() );
    95109
    96     $site_size = new Site_Size( 'file' );
     110    $site_size = new Site_Size( 'file' );
    97111    $excluded_site_size = new Site_Size( 'file', $excludes );
    98112
    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    ?>
    101116
    102117    <table class="widefat">
     
    106121            <tr>
    107122                <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>
    113128            </tr>
    114129
     
    123138                    <?php if ( Path::get_root() !== $directory ) : ?>
    124139
    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>
    126143                        <code>/</code>
    127144
    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                        ) );
    129150
    130151                        foreach ( $parents as $directory_basename ) : ?>
    131152
    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>
    133156                            <code>/</code>
    134157
     
    153176                    <?php else :
    154177
    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                        ?>
    159183
    160184                            <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>
    164197                            </code>
    165198
     
    175208
    176209                        <?php if ( is_link( Path::get_root() ) ) :
    177                             _e( 'Symlink', 'backupwordpress' );
     210                            _e( 'Symlink', 'backupwordpress' );
    178211                        elseif ( is_dir( Path::get_root() ) ) :
    179                             _e( 'Folder', 'backupwordpress' );
     212                            _e( 'Folder', 'backupwordpress' );
    180213                        endif; ?>
    181214
     
    198231                $is_excluded = $is_unreadable = false;
    199232
    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                ) :
    202238                    $is_excluded = true;
    203239                endif;
    204240
    205                 // Skip unreadable files
     241                // Skip unreadable files
    206242                if ( ! @realpath( $file->getPathname() ) || ! $file->isReadable() ) :
    207243                    $is_unreadable = true;
    208                 endif; ?>
     244                endif;
     245                ?>
    209246
    210247                <tr>
     
    232269                        <?php if ( $is_unreadable ) : ?>
    233270
    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>
    235274
    236275                        <?php elseif ( $file->isFile() ) : ?>
    237276
    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>
    239280
    240281                        <?php elseif ( $file->isDir() ) : ?>
    241282
    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>
    243288
    244289                        <?php endif; ?>
     
    254299
    255300                            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'; ?>
    258303
    259304                                <code>
    260305
    261306                                    <?php if ( $file->isDir() ) :
     307
    262308                                        $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
    264317                                    elseif ( ! $is_unreadable ) :
    265                                         echo esc_html( $size );
     318                                        echo esc_html( );
    266319                                    else :
    267320                                        echo '-';
     
    275328
    276329                            <?php endif;
    277                         endif; ?>
     330                        endif;
     331                        ?>
    278332
    279333                    </td>
     
    292346                        <code>
    293347                        <?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>
    295351                        <?php elseif ( $file->isDir() ) :
    296                             _e( 'Folder', 'backupwordpress' );
     352                            _e( 'Folder', 'backupwordpress' );
    297353                        else :
    298                             _e( 'File', 'backupwordpress' );
     354                            _e( 'File', 'backupwordpress' );
    299355                        endif; ?>
    300356                        </code>
     
    305361                        <?php if ( $is_unreadable ) : ?>
    306362
    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>
    308366
    309367                        <?php elseif ( $is_excluded ) : ?>
    310368
    311                             <strong><?php _e( 'Excluded', 'backupwordpress' ); ?></strong>
     369                            <strong><?php _e( 'Excluded', 'backupwordpress' ); ?></strong>
    312370
    313371                        <?php else :
     
    315373                            $exclude_path = $file->getPathname();
    316374
    317                             // Excluded directories need to be trailingslashed
     375                            // Excluded directories need to be trailingslashed
    318376                            if ( $file->isDir() ) :
    319377                                $exclude_path = trailingslashit( wp_normalize_path( $file->getPathname() ) );
    320378                            endif; ?>
    321379
    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 &rarr;', '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 &rarr;', 'backupwordpress' ); ?>
     392                            </a>
    327393
    328394                        <?php endif; ?>
     
    337403
    338404            <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>
    340408            </tr>
    341409
     
    347415
    348416    <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>
    350420    </p>
    351421
  • 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
     1var BackUpWordPressAdmin=function(a){"use strict";function b(){d=a("select#hmbkp_schedule_recurrence_type"),
     2// Don't ever cache ajax requests
     3a.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
     5a(document).on("click",".hmbkp-schedule-actions .delete-action",function(a){confirm(hmbkp.delete_schedule)||a.preventDefault()}),
     6// Show delete confirm message for delete backup
     7a(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
     9a(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
     11a.post(ajaxurl,{nonce:hmbkp.nonce,action:"hmbkp_cron_test"},function(b){"1"!==b&&a(".wrap > h2").after(b)}),
     12// Run a backup
     13a(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
     15a(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
     17a(document).on("heartbeat-tick",function(b,c){if(
     18// If the schedule has finished then reload the page
     190!==c.hmbkp_schedule_status||a(".hmbkp-error").length||location.reload(!0),
     20// If the schedule is still running then update the schedule status
     210!==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
     23a(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
    224case"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  
    44Plugin URI: http://bwp.hmn.md/
    55Description: Simple automated backups of your WordPress powered website. Once activated you'll find me under <strong>Tools &rarr; Backups</strong>. On multisite, you'll find me under the Network Settings menu.
    6 Version: 3.6.1
     6Version: 3.6.
    77Author: Human Made Limited
    88Author URI: http://hmn.md/
  • backupwordpress/trunk/classes/backup/class-backup-engine-database-mysqldump.php

    r1405409 r1466192  
    8080
    8181    /**
    82      * Check whether it's possible to connect to the database with the
    83      * 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 connection
    97         $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     /**
    11882     * Perform the database backup.
    11983     *
     
    12286    public function backup() {
    12387
    124         if ( ! $this->check_user_can_connect_to_database_via_cli() || ! $this->get_mysqldump_executable_path() ) {
     88        if ( ! $this->get_mysqldump_executable_path() ) {
    12589            return false;
    12690        }
  • backupwordpress/trunk/classes/class-plugin.php

    r1405409 r1466192  
    77 */
    88final class Plugin {
    9     const PLUGIN_VERSION = '3.6.1';
     9    const PLUGIN_VERSION = '3.6.';
    1010
    1111    /**
     
    129129        require_once( HMBKP_PLUGIN_PATH . 'classes/class-notices.php' );
    130130
    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' );
    132133        require_once( HMBKP_PLUGIN_PATH . 'admin/menu.php' );
    133134        require_once( HMBKP_PLUGIN_PATH . 'admin/actions.php' );
  • backupwordpress/trunk/classes/class-scheduled-backup.php

    r1383488 r1466192  
    649649        if ( get_option( 'hmbkp_schedule_' . $this->get_id() ) !== $this->options ) {
    650650            update_option( 'hmbkp_schedule_' . $this->get_id(), $this->options );
     651
     652
     653
    651654        }
    652655
     
    666669        delete_option( 'hmbkp_schedule_' . $this->get_id() );
    667670
     671
     672
     673
    668674        // Clear any existing schedules
    669675        $this->unschedule();
  • backupwordpress/trunk/classes/class-schedules.php

    r1383488 r1466192  
    4141    public function refresh_schedules() {
    4242
    43         global $wpdb;
     43        ;
    4444
    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        }
    4754
    4855        // Instantiate each one as a Scheduled_Backup
  • backupwordpress/trunk/classes/class-site-size.php

    r1368515 r1466192  
    5151        if ( 'file' !== $this->type ) {
    5252
    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 );
    5866            }
    5967        }
     
    186194    public function directory_filesize( \SplFileInfo $file ) {
    187195
     196
     197
     198
     199
     200
     201
     202
     203
     204
    188205        // If we haven't calculated the site size yet then kick it off in a thread
    189206        $directory_sizes = $this->get_cached_filesizes();
     
    196213        }
    197214
    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         */
    199219        $directory_sizes = array_flip( preg_grep( '(' . wp_normalize_path( $file->getRealPath() ) . ')', array_flip( $directory_sizes ) ) );
    200220
     
    207227        }
    208228
    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;
    211238
    212239    }
  • backupwordpress/trunk/languages/backupwordpress.pot

    r1405409 r1466192  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: BackUpWordPress 3.6.1\n"
     5"Project-Id-Version: BackUpWordPress 3.6.\n"
    66"Report-Msgid-Bugs-To: backupwordpress@hmn.md\n"
    7 "POT-Creation-Date: 2016-04-26 15:47:53+00:00\n"
     7"POT-Creation-Date: 2016-0+00:00\n"
    88"MIME-Version: 1.0\n"
    99"Content-Type: text/plain; charset=utf-8\n"
     
    6868msgstr ""
    6969
    70 #: admin/actions.php:636 admin/actions.php:642
     70#: admin/actions.php:63
    7171msgid "BackUpWordPress has detected a problem."
    7272msgstr ""
    7373
    74 #: admin/actions.php:636
     74#: admin/actions.php:63
    7575msgid ""
    7676"%1$s is returning a %2$s response which could mean cron jobs aren't getting "
     
    7979msgstr ""
    8080
    81 #: admin/actions.php:642
     81#: admin/actions.php:64
    8282msgid ""
    8383"%1$s is returning a %2$s response which could mean cron jobs aren't getting "
     
    9191msgstr ""
    9292
    93 #: admin/backups-table.php:15 admin/schedule-form-excludes.php:111
     93#: admin/backups-table.php:15 admin/schedule-form-excludes.php:1
    9494msgid "Type"
    9595msgstr ""
     
    489489msgstr ""
    490490
    491 #: admin/schedule-form-excludes.php:14
    492 msgid ""
    493 "We automatically detect and ignore common <abbr title=\"Version Control "
    494 "Systems\">VCS</abbr> folders and other backup plugin folders."
    495 msgstr ""
    496 
    497 #: admin/schedule-form-excludes.php:50
     491#: admin/schedule-form-excludes.php:1
     492msgid ""
     493"We automatically detect and ignore common "
     494"and other backup plugin folders."
     495msgstr ""
     496
     497#: admin/schedule-form-excludes.php:5
    498498msgid "Default rule"
    499499msgstr ""
    500500
    501 #: admin/schedule-form-excludes.php:54
    502 msgid "Defined in wp-config.php"
    503 msgstr ""
    504 
    505 #: admin/schedule-form-excludes.php:61
     501#: admin/schedule-form-excludes.php:5
     502msgid "Defined in "
     503msgstr ""
     504
     505#: admin/schedule-form-excludes.php:6
    506506msgid "Stop excluding"
    507507msgstr ""
    508508
    509 #: admin/schedule-form-excludes.php:75
     509#: admin/schedule-form-excludes.php:
    510510msgid "Your Site"
    511511msgstr ""
    512512
    513 #: admin/schedule-form-excludes.php:77
     513#: admin/schedule-form-excludes.php:7
    514514msgid ""
    515515"Here's a directory listing of all files on your site, you can browse "
     
    518518msgstr ""
    519519
    520 #: admin/schedule-form-excludes.php:108
     520#: admin/schedule-form-excludes.php:1
    521521msgid "Name"
    522522msgstr ""
    523523
    524 #: admin/schedule-form-excludes.php:109
     524#: admin/schedule-form-excludes.php:1
    525525msgid "Included Size"
    526526msgstr ""
    527527
    528 #: admin/schedule-form-excludes.php:110
     528#: admin/schedule-form-excludes.php:1
    529529msgid "Permissions"
    530530msgstr ""
    531531
    532 #: admin/schedule-form-excludes.php:112
     532#: admin/schedule-form-excludes.php:1
    533533msgid "Status"
    534534msgstr ""
    535535
    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
     538msgid "%1$s of %2$s"
     539msgstr ""
     540
     541#: admin/schedule-form-excludes.php:195
    541542msgid "Refresh"
    542543msgstr ""
    543544
    544 #: admin/schedule-form-excludes.php:177 admin/schedule-form-excludes.php:294
     545#: admin/schedule-form-excludes.php:
    545546msgid "Symlink"
    546547msgstr ""
    547548
    548 #: admin/schedule-form-excludes.php:179 admin/schedule-form-excludes.php:296
     549#: admin/schedule-form-excludes.php:
    549550msgid "Folder"
    550551msgstr ""
    551552
    552 #: admin/schedule-form-excludes.php:298
     553#: admin/schedule-form-excludes.php:
    553554msgid "File"
    554555msgstr ""
    555556
    556 #: admin/schedule-form-excludes.php:307
     557#: admin/schedule-form-excludes.php:3
    557558msgid "Unreadable files won't be backed up."
    558559msgstr ""
    559560
    560 #: admin/schedule-form-excludes.php:307
     561#: admin/schedule-form-excludes.php:3
    561562msgid "Unreadable"
    562563msgstr ""
    563564
    564 #: admin/schedule-form-excludes.php:311
     565#: admin/schedule-form-excludes.php:3
    565566msgid "Excluded"
    566567msgstr ""
    567568
    568 #: admin/schedule-form-excludes.php:326
     569#: admin/schedule-form-excludes.php:3
    569570msgid "Exclude &rarr;"
    570571msgstr ""
    571572
    572 #: admin/schedule-form-excludes.php:339
     573#: admin/schedule-form-excludes.php:
    573574msgid "This folder is empty"
    574575msgstr ""
    575576
    576 #: admin/schedule-form-excludes.php:349 admin/schedule-form.php:204
     577#: admin/schedule-form-excludes.php: admin/schedule-form.php:204
    577578#: admin/schedule-settings.php:85
    578579msgid "Done"
     
    870871msgstr ""
    871872
    872 #: classes/class-plugin.php:240
     873#: classes/class-plugin.php:24
    873874msgid "Update"
    874875msgstr ""
    875876
    876 #: classes/class-plugin.php:241
     877#: classes/class-plugin.php:24
    877878msgid "Cancel"
    878879msgstr ""
    879880
    880 #: classes/class-plugin.php:242
     881#: classes/class-plugin.php:24
    881882msgid ""
    882883"Are you sure you want to delete this schedule? All of its backups will also "
     
    884885msgstr ""
    885886
    886 #: classes/class-plugin.php:242 classes/class-plugin.php:243
    887 #: classes/class-plugin.php:244 classes/class-plugin.php:245
     887#: classes/class-plugin.php:24
     888#: classes/class-plugin.php:24
    888889msgid "'Cancel' to go back, 'OK' to delete."
    889890msgstr ""
    890891
    891 #: classes/class-plugin.php:243
     892#: classes/class-plugin.php:24
    892893msgid "Are you sure you want to delete this backup?"
    893894msgstr ""
    894895
    895 #: classes/class-plugin.php:244
     896#: classes/class-plugin.php:24
    896897msgid "Are you sure you want to remove this exclude rule?"
    897898msgstr ""
    898899
    899 #: classes/class-plugin.php:245
     900#: classes/class-plugin.php:24
    900901msgid ""
    901902"Reducing the number of backups that are stored on this server will cause "
     
    904905msgstr ""
    905906
    906 #: classes/class-plugin.php:444
     907#: classes/class-plugin.php:44
    907908#. translators: %1$s and %2$s expand to anchor tags linking to the new
    908909#. extensions page.
     
    912913msgstr ""
    913914
    914 #: classes/class-plugin.php:454
     915#: classes/class-plugin.php:45
    915916msgid "Dismiss this notice."
    916917msgstr ""
  • backupwordpress/trunk/readme.txt

    r1410323 r1466192  
    11=== BackUpWordPress ===
    2 Contributors: humanmade, willmot, pauldewouters, joehoyle, mattheu, tcrsavage, cuvelier
     2Contributors: humanmade, willmot, pauldewouters, joehoyle, mattheu, tcrsavage, cuvelier
    33Tags: back up, backup, backups, database, zip, db, files, archive, wp-cli, humanmade
    44Requires at least: 3.9
    5 Tested up to: 4.4.2
    6 Stable tag: 3.6.1
     5Tested up to: 4.
     6Stable tag: 3.6.
    77
    88Simple automated backups of your WordPress-powered website.
     
    158158
    159159== Changelog ==
     160
     161
     162
     163
     164
     165
     166
     167
     168
     169
    160170
    161171### 3.6.0 / 2016-03-31
  • backupwordpress/trunk/vendor/composer/autoload_classmap.php

    r1405409 r1466192  
    77
    88return 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',
    749);
  • backupwordpress/trunk/vendor/composer/installed.json

    r1383488 r1466192  
    5656    {
    5757        "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",
    6060        "source": {
    6161            "type": "git",
    6262            "url": "https://github.com/symfony/finder.git",
    63             "reference": "ca24cf2cd4e3826f571e0067e535758e73807aa1"
     63            "reference": ""
    6464        },
    6565        "dist": {
    6666            "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": "",
    6969            "shasum": ""
    7070        },
     
    7272            "php": ">=5.3.9"
    7373        },
    74         "time": "2016-03-10 10:53:53",
     74        "time": "2016-0",
    7575        "type": "library",
    7676        "extra": {
     
    107107    {
    108108        "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",
    111111        "source": {
    112112            "type": "git",
    113113            "url": "https://github.com/symfony/process.git",
    114             "reference": "fb467471952ef5cf8497c029980e556b47545333"
     114            "reference": ""
    115115        },
    116116        "dist": {
    117117            "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": "",
    120120            "shasum": ""
    121121        },
     
    123123            "php": ">=5.3.9"
    124124        },
    125         "time": "2016-03-23 13:11:46",
     125        "time": "2016-0",
    126126        "type": "library",
    127127        "extra": {
  • backupwordpress/trunk/vendor/symfony/finder/Expression/Expression.php

    r1332238 r1466192  
    126126
    127127    /**
     128
     129
    128130     * @throws \LogicException
    129      *
    130      * @return Glob
    131131     */
    132132    public function getGlob()
  • backupwordpress/trunk/vendor/symfony/finder/Finder.php

    r1332238 r1466192  
    134134     * @param string $name
    135135     *
     136
     137
    136138     * @throws \InvalidArgumentException
    137      *
    138      * @return Finder The current Finder instance
    139139     *
    140140     * @deprecated since 2.8, to be removed in 3.0.
     
    193193     * Restricts the matching to directories only.
    194194     *
    195      * @return Finder The current Finder instance
     195     * @return Finder The current Finder instance
    196196     */
    197197    public function directories()
     
    205205     * Restricts the matching to files only.
    206206     *
    207      * @return Finder The current Finder instance
     207     * @return Finder The current Finder instance
    208208     */
    209209    public function files()
     
    224224     * @param int $level The depth level expression
    225225     *
    226      * @return Finder The current Finder instance
     226     * @return Finder The current Finder instance
    227227     *
    228228     * @see DepthRangeFilterIterator
     
    248248     * @param string $date A date range string
    249249     *
    250      * @return Finder The current Finder instance
     250     * @return Finder The current Finder instance
    251251     *
    252252     * @see strtotime
     
    272272     * @param string $pattern A pattern (a regexp, a glob, or a string)
    273273     *
    274      * @return Finder The current Finder instance
     274     * @return Finder The current Finder instance
    275275     *
    276276     * @see FilenameFilterIterator
     
    288288     * @param string $pattern A pattern (a regexp, a glob, or a string)
    289289     *
    290      * @return Finder The current Finder instance
     290     * @return Finder The current Finder instance
    291291     *
    292292     * @see FilenameFilterIterator
     
    309309     * @param string $pattern A pattern (string or regexp)
    310310     *
    311      * @return Finder The current Finder instance
     311     * @return Finder The current Finder instance
    312312     *
    313313     * @see FilecontentFilterIterator
     
    330330     * @param string $pattern A pattern (string or regexp)
    331331     *
    332      * @return Finder The current Finder instance
     332     * @return Finder The current Finder instance
    333333     *
    334334     * @see FilecontentFilterIterator
     
    353353     * @param string $pattern A pattern (a regexp or a string)
    354354     *
    355      * @return Finder The current Finder instance
     355     * @return Finder The current Finder instance
    356356     *
    357357     * @see FilenameFilterIterator
     
    376376     * @param string $pattern A pattern (a regexp or a string)
    377377     *
    378      * @return Finder The current Finder instance
     378     * @return Finder The current Finder instance
    379379     *
    380380     * @see FilenameFilterIterator
     
    396396     * @param string $size A size range string
    397397     *
    398      * @return Finder The current Finder instance
     398     * @return Finder The current Finder instance
    399399     *
    400400     * @see SizeRangeFilterIterator
     
    413413     * @param string|array $dirs A directory path or an array of directories
    414414     *
    415      * @return Finder The current Finder instance
     415     * @return Finder The current Finder instance
    416416     *
    417417     * @see ExcludeDirectoryFilterIterator
     
    429429     * @param bool $ignoreDotFiles Whether to exclude "hidden" files or not
    430430     *
    431      * @return Finder The current Finder instance
     431     * @return Finder The current Finder instance
    432432     *
    433433     * @see ExcludeDirectoryFilterIterator
     
    449449     * @param bool $ignoreVCS Whether to exclude VCS files or not
    450450     *
    451      * @return Finder The current Finder instance
     451     * @return Finder The current Finder instance
    452452     *
    453453     * @see ExcludeDirectoryFilterIterator
     
    489489     * @param \Closure $closure An anonymous function
    490490     *
    491      * @return Finder The current Finder instance
     491     * @return Finder The current Finder instance
    492492     *
    493493     * @see SortableIterator
     
    505505     * This can be slow as all the matching files and directories must be retrieved for comparison.
    506506     *
    507      * @return Finder The current Finder instance
     507     * @return Finder The current Finder instance
    508508     *
    509509     * @see SortableIterator
     
    521521     * This can be slow as all the matching files and directories must be retrieved for comparison.
    522522     *
    523      * @return Finder The current Finder instance
     523     * @return Finder The current Finder instance
    524524     *
    525525     * @see SortableIterator
     
    539539     * This can be slow as all the matching files and directories must be retrieved for comparison.
    540540     *
    541      * @return Finder The current Finder instance
     541     * @return Finder The current Finder instance
    542542     *
    543543     * @see SortableIterator
     
    559559     * This can be slow as all the matching files and directories must be retrieved for comparison.
    560560     *
    561      * @return Finder The current Finder instance
     561     * @return Finder The current Finder instance
    562562     *
    563563     * @see SortableIterator
     
    577577     * This can be slow as all the matching files and directories must be retrieved for comparison.
    578578     *
    579      * @return Finder The current Finder instance
     579     * @return Finder The current Finder instance
    580580     *
    581581     * @see SortableIterator
     
    596596     * @param \Closure $closure An anonymous function
    597597     *
    598      * @return Finder The current Finder instance
     598     * @return Finder The current Finder instance
    599599     *
    600600     * @see CustomFilterIterator
     
    610610     * Forces the following of symlinks.
    611611     *
    612      * @return Finder The current Finder instance
     612     * @return Finder The current Finder instance
    613613     */
    614614    public function followLinks()
     
    626626     * @param bool $ignore
    627627     *
    628      * @return Finder The current Finder instance
     628     * @return Finder The current Finder instance
    629629     */
    630630    public function ignoreUnreadableDirs($ignore = true)
     
    640640     * @param string|array $dirs A directory path or an array of directories
    641641     *
    642      * @return Finder The current Finder instance
     642     * @return Finder The current Finder instance
    643643     *
    644644     * @throws \InvalidArgumentException if one of the directories does not exist
     
    668668     * This method implements the IteratorAggregate interface.
    669669     *
    670      * @return \Iterator An iterator
     670     * @return \Iterator An iterator
    671671     *
    672672     * @throws \LogicException if the in() method has not been called
     
    701701     * @param mixed $iterator
    702702     *
    703      * @return Finder The finder
     703     * @return Finder The finder
    704704     *
    705705     * @throws \InvalidArgumentException When the given argument is not iterable.
  • backupwordpress/trunk/vendor/symfony/finder/Iterator/PathFilterIterator.php

    r1332238 r1466192  
    4646     * Use only / as directory separator (on Windows also).
    4747     *
    48      * @param string $str Pattern: regexp or dirname.
     48     * @param string $str Pattern: regexp or dirname
    4949     *
    5050     * @return string regexp corresponding to a given string or regexp
  • backupwordpress/trunk/vendor/symfony/process/Pipes/AbstractPipes.php

    r1383488 r1466192  
    2323
    2424    /** @var string */
    25     protected $inputBuffer = '';
     25    pr $inputBuffer = '';
    2626    /** @var resource|null */
    27     protected $input;
    28 
     27    private $input;
    2928    /** @var bool */
    3029    private $blocked = true;
     
    9291            return;
    9392        }
    94 
    95         $e = array();
    96         $r = null !== $this->input ? array($this->input) : $e;
     93        $input = $this->input;
     94        $r = $e = array();
    9795        $w = array($this->pipes[0]);
    9896
     
    111109            }
    112110
    113             foreach ($r as $input) {
     111            $input) {
    114112                for (;;) {
    115113                    $data = fread($input, self::CHUNK_SIZE);
     
    125123                    }
    126124                }
    127                 if (!isset($data[0]) && feof($input)) {
     125                if (feof($input)) {
    128126                    // no more data to read on input resource
    129127                    // use an empty buffer in the next reads
  • backupwordpress/trunk/vendor/symfony/process/Pipes/PipesInterface.php

    r1368515 r1466192  
    4040     * Reads data in file handles and pipes.
    4141     *
    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
    4444     *
    45      * @return string[] An array of read data indexed by their fd.
     45     * @return string[] An array of read data indexed by their fd
    4646     */
    4747    public function readAndWrite($blocking, $close = false);
  • backupwordpress/trunk/vendor/symfony/process/Pipes/WindowsPipes.php

    r1383488 r1466192  
    4848            //
    4949            // @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 => ,
    5353            );
    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;
    5775                }
    58             }
     76                break;
     77            }
     78            restore_error_handler();
    5979        }
    6080
  • backupwordpress/trunk/vendor/symfony/process/Process.php

    r1383488 r1466192  
    159159        }
    160160
    161         $this->input = $input;
     161        $this->;
    162162        $this->setTimeout($timeout);
    163163        $this->useFileHandles = '\\' === DIRECTORY_SEPARATOR;
     
    478478     * output, this one returns the new output since the last call.
    479479     *
     480
     481
    480482     * @throws LogicException in case the output has been disabled
    481483     * @throws LogicException In case the process is not started
    482      *
    483      * @return string The process output since the last call
    484484     */
    485485    public function getIncrementalOutput()
     
    537537     * call.
    538538     *
     539
     540
    539541     * @throws LogicException in case the output has been disabled
    540542     * @throws LogicException In case the process is not started
    541      *
    542      * @return string The process error output since the last call
    543543     */
    544544    public function getIncrementalErrorOutput()
     
    594594     * and might not be relevant for other operating systems.
    595595     *
    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
    597597     *
    598598     * @see http://tldp.org/LDP/abs/html/exitcodes.html
     
    882882     * @param int|float|null $timeout The timeout in seconds
    883883     *
    884      * @return self The current Process instance.
     884     * @return self The current Process instance
    885885     *
    886886     * @throws LogicException           if the output is disabled
     
    10881088        }
    10891089
    1090         $this->input = ProcessUtils::validateInput(sprintf('%s::%s', __CLASS__, __FUNCTION__), $input);
     1090        $this->input = ProcessUtils::validateInput(, $input);
    10911091
    10921092        return $this;
     
    12661266     * Updates the status of the process, reads pipes.
    12671267     *
    1268      * @param bool $blocking Whether to use a blocking read call.
     1268     * @param bool $blocking Whether to use a blocking read call
    12691269     */
    12701270    protected function updateStatus($blocking)
     
    13521352     * Reads pipes, executes callback.
    13531353     *
    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
    13561356     */
    13571357    private function readPipes($blocking, $close)
     
    14791479     * Ensures the process is running or terminated, throws a LogicException if the process has a not started.
    14801480     *
    1481      * @param string $functionName The function name that was called.
     1481     * @param string $functionName The function name that was called
    14821482     *
    14831483     * @throws LogicException If the process has not run.
     
    14931493     * Ensures the process is terminated, throws a LogicException if the process has a status different than `terminated`.
    14941494     *
    1495      * @param string $functionName The function name that was called.
     1495     * @param string $functionName The function name that was called
    14961496     *
    14971497     * @throws LogicException If the process is not yet terminated.
  • backupwordpress/trunk/vendor/symfony/process/ProcessBuilder.php

    r1368515 r1466192  
    178178    public function setInput($input)
    179179    {
    180         $this->input = ProcessUtils::validateInput(sprintf('%s::%s', __CLASS__, __FUNCTION__), $input);
     180        $this->input = ProcessUtils::validateInput(, $input);
    181181
    182182        return $this;
  • backupwordpress/trunk/vendor/symfony/process/ProcessUtils.php

    r1368515 r1466192  
    8181     * @param mixed  $input  The input to validate
    8282     *
    83      * @return string The validated input
     83     * @return The validated input
    8484     *
    8585     * @throws InvalidArgumentException In case the input is not valid
     
    9191        if (null !== $input) {
    9292            if (is_resource($input)) {
     93
     94
     95
    9396                return $input;
    9497            }
  • backupwordpress/trunk/vendor/symfony/process/Tests/ProcessTest.php

    r1383488 r1466192  
    5555    public function testThatProcessDoesNotThrowWarningDuringRun()
    5656    {
     57
     58
     59
    5760        @trigger_error('Test Error', E_USER_NOTICE);
    5861        $process = $this->getProcess(self::$phpBin." -r 'sleep(3)'");
     
    208211        $this->assertEquals($expectedLength, strlen($p->getOutput()));
    209212        $this->assertEquals($expectedLength, strlen($p->getErrorOutput()));
     213
     214
     215
     216
     217
     218
     219
     220
     221
     222
     223
     224
     225
     226
     227
     228
     229
     230
    210231    }
    211232
     
    11631184     * @dataProvider provideVariousIncrementals
    11641185     */
    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);
    11671189        $process->start();
    11681190        $result = '';
     
    11781200    }
    11791201
    1180     public function provideVariousIncrementals() {
     1202    public function provideVariousIncrementals()
     1203    {
    11811204        return array(
    11821205            array('php://stdout', 'getIncrementalOutput'),
    11831206            array('php://stderr', 'getIncrementalErrorOutput'),
    11841207        );
    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;
    12031208    }
    12041209
     
    12251230                $this->assertSame('This PHP has been compiled with --enable-sigchild. You must use setEnhanceSigchildCompatibility() to use this method.', $e->getMessage());
    12261231                if ($enhance) {
    1227                     $process->setEnhanceSigChildCompatibility(true);
     1232                    $process->setEnhanceSighildCompatibility(true);
    12281233                } else {
    12291234                    self::$notEnhancedSigchild = true;
Note: See TracChangeset for help on using the changeset viewer.