Changeset 11934 for trunk/wp-admin/includes/class-wp-filesystem-direct.php
- 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-direct.php
r11930 r11934 308 308 } 309 309 310 function dirlist($path, $inc dot = false, $recursive = false) {310 function dirlist($path, $include_hidden = true, $recursive = false) { 311 311 if ( $this->is_file($path) ) { 312 $limit File = basename($path);312 $limit_file = basename($path); 313 313 $path = dirname($path); 314 314 } else { 315 $limitFile = false; 316 } 315 $limit_file = false; 316 } 317 317 318 if ( ! $this->is_dir($path) ) 318 319 return false; 319 320 320 $ret = array();321 321 $dir = @dir($path); 322 322 if ( ! $dir ) 323 323 return false; 324 325 $ret = array(); 326 324 327 while (false !== ($entry = $dir->read()) ) { 325 328 $struc = array(); … … 327 330 328 331 if ( '.' == $struc['name'] || '..' == $struc['name'] ) 329 continue; //Do not care about these folders.330 if ( '.' == $struc['name'][0] && !$incdot)331 332 continue; 332 if ( $limitFile && $struc['name'] != $limitFile) 333 334 if ( ! $include_hidden && '.' == $struc['name'][0] ) 335 continue; 336 337 if ( $limit_file && $struc['name'] != $limit_file) 333 338 continue; 334 339 … … 346 351 if ( 'd' == $struc['type'] ) { 347 352 if ( $recursive ) 348 $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $inc dot, $recursive);353 $struc['files'] = $this->dirlist($path . '/' . $struc['name'], $include_hidden, $recursive); 349 354 else 350 355 $struc['files'] = array();
Note: See TracChangeset
for help on using the changeset viewer.