- Timestamp:
- 09/15/2009 02:21:00 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/class-wp-filesystem-ftpsockets.php
r11930 r11934 123 123 124 124 $temp = wp_tempnam( $file ); 125 if ( ! $temphandle = fopen($temp, 'w+') ) {125 if ( ! $temphandle = fopen($temp, 'w+') ) { 126 126 unlink($temp); 127 127 return false; … … 167 167 return $this->ftp->chmod($file, $mode); 168 168 } 169 169 170 //Is a directory, and we want recursive 170 171 $filelist = $this->dirlist($file); 171 foreach ($filelist as $filename){172 foreach ( $filelist as $filename ) 172 173 $this->chmod($file . '/' . $filename, $mode, $recursive); 173 } 174 174 175 return true; 175 176 } … … 283 284 } 284 285 285 function dirlist($path = '.', $inc dot = false, $recursive = false ) {286 function dirlist($path = '.', $include_hidden = true, $recursive = false ) { 286 287 if ( $this->is_file($path) ) { 287 $limit File = basename($path);288 $limit_file = basename($path); 288 289 $path = dirname($path) . '/'; 289 290 } else { 290 $limit File = false;291 $limit_file = false; 291 292 } 292 293 … … 294 295 if ( ! $list ) 295 296 return false; 296 if ( empty($list) )297 return array();298 297 299 298 $ret = array(); 300 299 foreach ( $list as $struc ) { 301 300 301 if ( '.' == $struct['name'] || '..' == $struc['name'] ) 302 continue; 303 304 if ( ! $include_hidden && '.' == $struc['name'][0] ) 305 continue; 306 307 if ( $limit_file && $srtuc['name'] != $limit_file ) 308 continue; 309 302 310 if ( 'd' == $struc['type'] ) { 303 $struc['files'] = array(); 304 305 if ( $incdot ){ 306 //We're including the doted starts 307 if ( '.' != $struc['name'] && '..' != $struc['name'] ){ //Ok, It isnt a special folder 308 if ($recursive) 309 $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive); 310 } 311 } else { //No dots 312 if ($recursive) 313 $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $incdot, $recursive); 314 } 311 if ( $recursive ) 312 $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $include_hidden, $recursive); 313 else 314 $struc['files'] = array(); 315 315 } 316 //File 317 $ret[ $struc['name']] = $struc;316 317 $ret[ $struc['name'] ] = $struc; 318 318 } 319 319 return $ret;
Note: See TracChangeset
for help on using the changeset viewer.