Changeset 579669
- Timestamp:
- 07/31/2012 10:34:08 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
backup/trunk/functions.php
r576649 r579669 156 156 if ( @is_dir( $source ) ) { 157 157 $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 } 158 164 foreach ( $files as $file ) { 159 165 if ( ! @is_readable( $file ) ) … … 186 192 * @param string $destination Destination file where the archive will be stored. 187 193 * @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. 189 195 */ 190 196 function _zip_create_pclzip( $sources, $destination, $exclude = array() ) { … … 196 202 if ( @is_dir( $source ) ) { 197 203 $files = directory_list( $source, true, $exclude ); 204 if ( is_wp_error( $files ) ) { 205 delete_path( $destination ); 206 return $files; 207 } 198 208 $res = $zip->add( $files, PCLZIP_OPT_REMOVE_PATH, parent_dir( $source ) ); 199 209 if ( 0 == $res )
Note: See TracChangeset
for help on using the changeset viewer.