WordPress.org

Make WordPress Core


Ignore:
Timestamp:
03/22/2011 12:04:15 AM (10 years ago)
Author:
dd32
Message:

Optimisations to WP_Filesystem; Pass known information to called functions. Props aldenta (John Ford) for investigation and patch. See #10913

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-filesystem-ftpext.php

    r15086 r17525  
    184184        return $dir[$file]['group'];
    185185    }
    186     function copy($source, $destination, $overwrite = false ) {
     186    function copy($source, $destination, $overwrite = false, $mode = false) {
    187187        if ( ! $overwrite && $this->exists($destination) )
    188188            return false;
     
    190190        if ( false === $content)
    191191            return false;
    192         return $this->put_contents($destination, $content);
     192        return $this->put_contents($destination, $content, $mode);
    193193    }
    194194    function move($source, $destination, $overwrite = false) {
     
    196196    }
    197197
    198     function delete($file, $recursive = false ) {
     198    function delete($file, $recursive = false, $type = false) {
    199199        if ( empty($file) )
    200200            return false;
    201         if ( $this->is_file($file) )
     201        if ( 'f' == $type || $this->is_file($file) )
    202202            return @ftp_delete($this->link, $file);
    203203        if ( !$recursive )
     
    207207        if ( !empty($filelist) )
    208208            foreach ( $filelist as $delete_file )
    209                 $this->delete( trailingslashit($file) . $delete_file['name'], $recursive);
     209                $this->delete( trailingslashit($file) . $delete_file['name'], $recursive, $delete_file['type'] );
    210210        return @ftp_rmdir($this->link, $file);
    211211    }
Note: See TracChangeset for help on using the changeset viewer.