Make WordPress Core


Ignore:
File:
1 edited

Legend:

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

    r17926 r15590  
    2020         * constructor
    2121         *
    22          * @param mixed $arg ignored argument
    23          */
    24         function __construct($arg) {
     22         * @param mixed $arg ingored argument
     23         */
     24        function WP_Filesystem_Direct($arg) {
    2525                $this->method = 'direct';
    2626                $this->errors = new WP_Error();
     
    194194        }
    195195
    196         function copy($source, $destination, $overwrite = false, $mode = false) {
     196        function copy($source, $destination, $overwrite = false) {
    197197                if ( ! $overwrite && $this->exists($destination) )
    198198                        return false;
    199199
    200                 $rtval = copy($source, $destination);
    201                 if ( $mode )
    202                         $this->chmod($destination, $mode);
    203                 return $rtval;
     200                return copy($source, $destination);
    204201        }
    205202
     
    220217        }
    221218
    222         function delete($file, $recursive = false, $type = false) {
     219        function delete($file, $recursive = false) {
    223220                if ( empty($file) ) //Some filesystems report this as /, which can cause non-expected recursive deletion of all files in the filesystem.
    224221                        return false;
    225                 $file = str_replace('\\', '/', $file); //for win32, occasional problems deleting files otherwise
    226 
    227                 if ( 'f' == $type || $this->is_file($file) )
     222                $file = str_replace('\\', '/', $file); //for win32, occasional problems deleteing files otherwise
     223
     224                if ( $this->is_file($file) )
    228225                        return @unlink($file);
    229226                if ( ! $recursive && $this->is_dir($file) )
     
    237234                if ( is_array($filelist) ) //false if no files, So check first.
    238235                        foreach ($filelist as $filename => $fileinfo)
    239                                 if ( ! $this->delete($file . $filename, $recursive, $fileinfo['type']) )
     236                                if ( ! $this->delete($file . $filename, $recursive) )
    240237                                        $retval = false;
    241238
Note: See TracChangeset for help on using the changeset viewer.