- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-filesystem-direct.php
r17926 r15590 20 20 * constructor 21 21 * 22 * @param mixed $arg i gnored argument23 */ 24 function __construct($arg) {22 * @param mixed $arg ingored argument 23 */ 24 function WP_Filesystem_Direct($arg) { 25 25 $this->method = 'direct'; 26 26 $this->errors = new WP_Error(); … … 194 194 } 195 195 196 function copy($source, $destination, $overwrite = false , $mode = false) {196 function copy($source, $destination, $overwrite = false) { 197 197 if ( ! $overwrite && $this->exists($destination) ) 198 198 return false; 199 199 200 $rtval = copy($source, $destination); 201 if ( $mode ) 202 $this->chmod($destination, $mode); 203 return $rtval; 200 return copy($source, $destination); 204 201 } 205 202 … … 220 217 } 221 218 222 function delete($file, $recursive = false , $type = false) {219 function delete($file, $recursive = false) { 223 220 if ( empty($file) ) //Some filesystems report this as /, which can cause non-expected recursive deletion of all files in the filesystem. 224 221 return false; 225 $file = str_replace('\\', '/', $file); //for win32, occasional problems delet ing files otherwise226 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) ) 228 225 return @unlink($file); 229 226 if ( ! $recursive && $this->is_dir($file) ) … … 237 234 if ( is_array($filelist) ) //false if no files, So check first. 238 235 foreach ($filelist as $filename => $fileinfo) 239 if ( ! $this->delete($file . $filename, $recursive , $fileinfo['type']) )236 if ( ! $this->delete($file . $filename, $recursive) ) 240 237 $retval = false; 241 238
Note: See TracChangeset
for help on using the changeset viewer.