Plugin Directory

Changeset 579669


Ignore:
Timestamp:
07/31/2012 10:34:08 AM (13 years ago)
Author:
hel.io
Message:

Patch for the zipping functions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • backup/trunk/functions.php

    r576649 r579669  
    156156        if ( @is_dir( $source ) ) {
    157157            $files = directory_list( $source, true, $exclude );
     158            if ( is_wp_error( $files ) ) {
     159                $zip->unchangeAll();
     160                if ( file_exists( $destination ) )
     161                    delete_path( $destination );
     162                return $files;
     163            }
    158164            foreach ( $files as $file ) {
    159165                if ( ! @is_readable( $file ) )
     
    186192 * @param  string $destination Destination file where the archive will be stored.
    187193 * @param  array  $exclude     Directories and/or files to exclude from archive, defaults to empty array.
    188  * @return mixed               Returns TRUE on success or an instance of WP_Error on failure.]              [description]
     194 * @return mixed               Returns TRUE on success or an instance of WP_Error on failure.
    189195 */
    190196function _zip_create_pclzip( $sources, $destination, $exclude = array() ) {
     
    196202        if ( @is_dir( $source ) ) {
    197203            $files = directory_list( $source, true, $exclude );
     204            if ( is_wp_error( $files ) ) {
     205                delete_path( $destination );
     206                return $files;
     207            }
    198208            $res = $zip->add( $files, PCLZIP_OPT_REMOVE_PATH, parent_dir( $source ) );
    199209            if ( 0 == $res )
Note: See TracChangeset for help on using the changeset viewer.