Make WordPress Core


Ignore:
Timestamp:
03/22/2011 12:04:15 AM (13 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-ssh2.php

    r13770 r17525  
    239239    }
    240240
    241     function copy($source, $destination, $overwrite = false ) {
     241    function copy($source, $destination, $overwrite = false, $mode = false) {
    242242        if ( ! $overwrite && $this->exists($destination) )
    243243            return false;
     
    245245        if ( false === $content)
    246246            return false;
    247         return $this->put_contents($destination, $content);
     247        return $this->put_contents($destination, $content, $mode);
    248248    }
    249249
     
    252252    }
    253253
    254     function delete($file, $recursive = false) {
    255         if ( $this->is_file($file) )
     254    function delete($file, $recursive = false, $type = false) {
     255        if ( 'f' == $type || $this->is_file($file) )
    256256            return ssh2_sftp_unlink($this->sftp_link, $file);
    257257        if ( ! $recursive )
     
    260260        if ( is_array($filelist) ) {
    261261            foreach ( $filelist as $filename => $fileinfo) {
    262                 $this->delete($file . '/' . $filename, $recursive);
     262                $this->delete($file . '/' . $filename, $recursive, $fileinfo['type']);
    263263            }
    264264        }
Note: See TracChangeset for help on using the changeset viewer.